Skip to content

[RFR] Add filter to reference depending on another reference - #938

Open
vasiakorobkin wants to merge 1 commit into
marmelab:masterfrom
vasiakorobkin:callback-accepting_referenceField-permanentFilters
Open

[RFR] Add filter to reference depending on another reference#938
vasiakorobkin wants to merge 1 commit into
marmelab:masterfrom
vasiakorobkin:callback-accepting_referenceField-permanentFilters

Conversation

@vasiakorobkin

Copy link
Copy Markdown

I'd like to help you with resolving this issue: #810
It comes together with this PR in admin-config.

Here's sketch of my suggested solution, but I'm not sure if I'm on a right track.
I need your feedback in order to continue my work.
So please, review and tell me if I'm wrong.

@vasiakorobkin vasiakorobkin changed the title [WIP] Add filter to reference depending on another reference [RFR] Add filter to reference depending on another reference Mar 26, 2016
@manind007

Copy link
Copy Markdown

Hi, The below example also not working based on the expectations. Subcategories not filtered based on the selected category

var subCategories = [
{ category: 'tech', label: 'Computers', value: 'computers' },
{ category: 'tech', label: 'Gadgets', value: 'gadgets' },
{ category: 'lifestyle', label: 'Travel', value: 'travel' },
{ category: 'lifestyle', label: 'Fitness', value: 'fitness' }
];

          nga.field('category', 'choice')  
                .choices([ 
                    { label: 'Tech', value: 'tech' },
                    { label: 'Lifestyle', value: 'lifestyle' }
                ]),

            nga.field('subcategory', 'choice')
                .choices(function(entry) {  
                    return subCategories.filter(function (c) {
                        return c.category === entry.values.category
                    });
                }),

Pls help me

@vasiakorobkin

vasiakorobkin commented Apr 23, 2016

Copy link
Copy Markdown
Author

@manind007 Of course they're dosen't work, because this PR hasn't been completed and hasn't been merged. It is just feature proposal and it depends on ng-admin mantainers when it will be implemented.

@shawn11ZX

Copy link
Copy Markdown

I really need this feature. Hope it can be accepted soon.

@mradosta

Copy link
Copy Markdown

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants