Is it possible to change the dropdown for the field selection on this control? We have several "related" tables that can be filtered on and would like to group the fields on the table name & also allow for searching the combo with text input (ie: https://demos.telerik.com/kendo-ui/combobox/grouping).
JT
8 Answers, 1 is accepted
Hi JT,
The Kendo UI Filter widget utilizes the Kendo UI DropDownList widget internally. Since the demo that you refer to is for the Kendo UI ComboBox, I am afraid that the sorting and grouping of the fields is not available via the built-in options of the Filter.
It is important to point out that the items of the Kendo UI Filter are plain string values. An array of field names is set to be the data source of the DropDownList. Therefore, grouping over a plain string array is not possible.
Regards,
Tsvetomir
Progress Telerik
Any chance your could provide an example of adding the Kendo DropDownList searh function at the top of the list?
Like the search in this example?
https://demos.telerik.com/kendo-ui/dropdownlist/serverfiltering
I dont need the server filtering...It's just the example i found that had the search turned on.\
Thank you
Jeff
Hi Jeffrey,
The only option the DropDownList to feature the Search functionality is to manually set it after loading the filter expression:
$("select[data-bind='value: field']").getKendoDropDownList().setOptions({filter: "startswith"})
A feature request for having this option out-of-the-box has been provided in the item below. Feel free to cast your vote:
Regards,
Tsvetomir
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Hello
Yes that works. However, every time a new Filter Row is added to the object, you need to execute the line of code. Otherwise, newly added dropdowns wont have the Search Bar. Any suggestions on an event to key off of?
Thank you
Jeff
Hello Jeff,
My name is Nikolay and I will get hold of this ticket until my colleague Tsvetomir returns.
Indeed, that is correct. The provided code needs to be applied every time a new filter is added. I could suggest doing that in the Change event handler of the Filter.
Regards,
Nikolay
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Hi Jeffrey, we discover that you can change any component default values to what you want. That method also allows to see all available options, that are sometimes unavailable in the documentation!
If you want ALL your dropdownlist to be searchable, use this after loading kendo:
kendo.ui.DropDownList.prototype.options.filter = "contains";
If you only want it in the filter, set it to "contains" before creating your filter, and to "none", or original value, after you finished using your filter. It must stays at "contains" for the time the filter lives, because they re-create new dropdown when you edit it.
.
Hi Frederic,
It is correct that the widgets' initial options can be overridden the way you have shared. However, in order for the option to be applied to every instance, the code snippet has to be executed before the initialization of the first widget.
Also, this approach affects all widgets on all pages. Therefore, one should proceed with caution when overriding the initial settings of the Kendo UI widgets.
Regards,
Tsvetomir
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Hello
Thanks Frederic!, We use the Search Box on every drop down list on our site.
I would prefer this was an option on creation of the Filter Widget but this works fine.
Thank you very much,
Jeff