Skip to content

Conversation

@vasiakorobkin
Copy link

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

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
Copy link
Author

vasiakorobkin commented Apr 23, 2016

@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

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

@mradosta
Copy link

+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