Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a pinned choice filters, the defaultValue() property is not works. #1016

Closed
zhaowei opened this issue Apr 4, 2016 · 3 comments
Closed

Comments

@zhaowei
Copy link

zhaowei commented Apr 4, 2016

filters([
    nga.field('category', 'choice').pinned(true).defaultValue('tech').choices([
        { label: 'Tech', value: 'tech' },
        { label: 'Lifestyle', value: 'lifestyle' }
    ]).label('Category'),
    nga.field('subcategory', 'choice').choices(subCategories).label('Subcategory')
])

I have a pinned choice filters, the defaultValue() property is not works. select input is not selected

@SebLours
Copy link
Contributor

SebLours commented Apr 5, 2016

A filter can not have a default value.
The filter is selected when it's applied on the list.
You can "pre-select" a filter in the url /list?search={"category":"tech"}

You can use the ma-filtered-list-button directive:

<ma-filtered-list-button entity-name="entity" filter="{ category: 'tech'}">
</ma-filtered-list-button>

@jpradeep2003
Copy link

This seems to contradict #639 which says "You can now use defaultValue() on filter fields" Can you kindly clarify?

@Kmaschta
Copy link
Contributor

Hello,

As explained in the README, the GitHub issue tracker is for bugs and enhancement requests.
So I close this issue, but feel free to write a question on StackOverflow with the tag ng-admin.

Thanks for using ng-admin!

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

No branches or pull requests

5 participants