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

Search on TreeDropdownField with Array as a $sourceObject doesn't work. #1628

Closed
dnpg opened this issue Sep 22, 2016 · 1 comment
Closed

Comments

@dnpg
Copy link

dnpg commented Sep 22, 2016

If added this to my Page:

$fields->addFieldToTab('Root.Articles', $myField = new TreeDropdownField('Article1ID', 'Article 1', ArticlePage::get()->map('ID', 'Title')->toArray(),'ID','Title', true));

The TreeDropdwnField loads correctly but the search box doesn't filter the results. Do we need to do something else? Is there any documentation for this?

Thanks

@dhensby
Copy link
Contributor

dhensby commented Sep 23, 2016

You'll need to create your own filter function and bind it to the TreeDropdownField using setSearchFunction

The TreeDropDown doesn't accept array as an object as standard for searching against

@dhensby dhensby closed this as completed Sep 23, 2016
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

No branches or pull requests

2 participants