Make kendo.data.DataSource.filter case sensitive

6 posts, 0 answers
  1. Yuriy
    Yuriy avatar
    4 posts
    Member since:
    Jul 2015

    Posted 09 Jun Link to this post

    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

     

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Jun Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Yuriy
    Yuriy avatar
    4 posts
    Member since:
    Jul 2015

    Posted 14 Jun in reply to Pavlina Link to this post

    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

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 14 Jun Link to this post

    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
  6. Yuriy
    Yuriy avatar
    4 posts
    Member since:
    Jul 2015

    Posted 15 Jun Link to this post

    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

  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 16 Jun Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready