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

Make kendo.data.DataSource.filter case sensitive

5 Answers 1051 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yuriy
Top achievements
Rank 1
Yuriy asked on 09 Jun 2016, 04:15 PM

Hi,

I'm using client side grid dataSource filter: kendo.data.DataSource.filter with operator: "eq", but it returns case insensitive results.

For example:

<script>
var dataSource = new kendo.data.DataSource({
  data: [
    { firstName: "joe", lastName: "doe" },
    { firstName: "Joe", lastName: "Doe" }
  ]
});
dataSource.filter( { field: "lastName", operator: "eq", value: "doe" });
var view = dataSource.view();
console.log(view.length);
</script>

returns 2. 

Is there a way to make it case sensitive?

Thanks,

-Yuriy

 

 

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Jun 2016, 03:09 PM
Hello,

The case-insensitive filtering is switched by default. In order to make it case-sensitive you can use filterable ignoreCase option:
http://docs.telerik.com/kendo-ui/api/aspnet-mvc/Kendo.Mvc.UI.Fluent/GridBoundColumnFilterableBuilder#methods-IgnoreCase(System.Boolean)

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yuriy
Top achievements
Rank 1
answered on 14 Jun 2016, 01:17 PM

Hi Pavlina,

Thank you for quick turnaround on it, but the proposed solution works only on dataSource with static binding. I need it to work on dynamic one. There are couple of examples below, based on your demos:

static: http://dojo.telerik.com/AYUsi

dynamic: http://dojo.telerik.com/EFAwa (filter on button1 click event)

Is there any other way around it?

Thanks,

-Yuriy

0
Pavlina
Telerik team
answered on 14 Jun 2016, 03:55 PM
Hi,

When serverFiltering is turned on as it is in the case with remote service data (http://dojo.telerik.com/EFAwa) it is developer responsibility to filter the data on server side in case-sensitive manner and send back the filtered data set. Please note that Kendo UI is a client-side framework and such assistance related to the server side implementation is out of the scope of our support services.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yuriy
Top achievements
Rank 1
answered on 15 Jun 2016, 01:00 PM

Hi Pavlina,

It wan't my intention to make it server driven filter. I just copied demo example with remote data binding. Anyway, combining dataSource propetry serverFiltering:false (or simply removing it) or dataSource.ServerOperation(false) (in case of ASP.NET MVC) with filter param "ignoreCase:false" solves it.

Thanks,

-Yuriy

0
Pavlina
Telerik team
answered on 16 Jun 2016, 07:36 AM
Hello,

In case disabling server filtering is applicable solution for your scenario you can proceed this way. Do not hesitate to contact us again in case further questions arise.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Yuriy
Top achievements
Rank 1
Share this question
or