This is a migrated thread and some comments may be shown as answers.

Customizing the control that displays field selection.

8 Answers 37 Views
Filter
This is a migrated thread and some comments may be shown as answers.
JT
Top achievements
Rank 1
JT asked on 29 Jan 2020, 08:46 PM

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

Sort by
0
Tsvetomir
Telerik team
answered on 31 Jan 2020, 01:41 PM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jeffrey
Top achievements
Rank 1
Veteran
answered on 27 May 2020, 10:17 PM

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

0
Tsvetomir
Telerik team
answered on 29 May 2020, 03:01 PM

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:

https://feedback.telerik.com/kendo-jquery-ui/1468473-enable-search-filter-option-in-the-dropdownlist-widgets-for-the-fields-and-operators-in-the-filter-widget

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Jeffrey
Top achievements
Rank 1
Veteran
answered on 29 May 2020, 03:23 PM

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

0
Nikolay
Telerik team
answered on 02 Jun 2020, 12:22 PM

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Frederic
Top achievements
Rank 1
Veteran
answered on 19 Jun 2020, 02:06 AM

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.

.

0
Tsvetomir
Telerik team
answered on 19 Jun 2020, 03:14 PM

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Jeffrey
Top achievements
Rank 1
Veteran
answered on 19 Jun 2020, 03:20 PM

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

Tags
Filter
Asked by
JT
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Jeffrey
Top achievements
Rank 1
Veteran
Nikolay
Telerik team
Frederic
Top achievements
Rank 1
Veteran
Share this question
or