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

Change multi-checkbox filter search to use "starts-with" operator rather than "contains" operator

1 Answer 291 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 29 Aug 2019, 07:05 PM
I have several columns with their filterable options set like so:

filterable: { multi: true, search: true }

 

These options result in a multi-checkbox type filter that includes a search input so that the checkbox labels can be searched.

This search works with a "contains" operator.

Is there a way to set this search to work with a "starts-with" operator instead?

 

Example:

Looking at the attached screenshot you can see that I have enter the value "li" in the search and my checkbox labels all contain that value, but I would like here is for just the "Livingston" checkbox to be displayed, since "Livingston" starts with "li".

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 03 Sep 2019, 05:45 AM
Hi Dustin,

Thank you for the detail explanation of the implementation you need.

There is no built-in implementation that can provide the search bar with the ability to work with a "starts-with" operator. Still you can achieve that behavior by overriding the internal search functionality. To do that before initializing the Grid, place the new search function.

I have prepared a Dojo demo that illustrates the above approach:
Please contact us back in case of further assistance needed.
 
Regards,
Nikolay
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.
Tags
Grid
Asked by
Shane
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or