marmelab / marmelab/ng-admin

Add filter to reference depending on another reference

Open
#810 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
3.9k
Forks
703
PR merge metrics
No merged PRs in 30d

Description

Hi.

i have 2 reference fields, for example, permissions and users, and i want to filter users filed depending on permissions choice, something like:

``` php
myEntity.creationView()
.fields([
nga.field('permission_id', 'reference')
.targetEntity(permissions)
.targetField(nga.field('name')),
nga.field('user_id', 'reference')
.targetEntity(users)
.remoteComplete(true)
.targetField(nga.field('name'))
.permanentFilters({ 'permission_id': entry.values.permission_id })
.template('')
]);
```

Is it possible?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the creationView configuration and the two reference fields shown in the issue, including remoteComplete, permanentFilters, and the custom template. Check the discussion for the intended behavior; done should be a supported way to filter the users reference from the selected permission.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.