Kendo Grid Filtering at client Side Issue

4 posts, 0 answers
  1. Sunny
    Sunny avatar
    1 posts
    Member since:
    Sep 2012

    Posted 18 Sep 2012 Link to this post

    Hi,
    Below is my code,

     var _fltMain = { logic: "or", filters: [] };
     var _fltRegion = { logic: "or", filters: [] };
     _fltRegion.filters.push({ field: "Region", operator: "contains", value: searchText });
      var _fltOAMOrders = { logic: "or", filters: [] };
     _fltOAMOrders.filters.push({ field: "OAMOrders", operator: "contains", value: searchText });
     
    _fltMain.filters.push(_fltRegion);
     _fltMain.filters.push(_fltOAMOrders);

     $("#reportGrid").data("kendoGrid").dataSource.query({ filter: _fltMain });

    This Code works fine for first filter but not working for fltOAMOrders this filter.
    It gives error
    Microsoft JScript runtime error: Object doesn't support this property or method
    ((d.OAMOrders || '').toLowerCase().indexOf('56') >= 0)
    because it is of type decimal.

    Please help.

    Thanks,
    Sunny.

  2. Brian
    Brian avatar
    1 posts
    Member since:
    Aug 2011

    Posted 31 Oct 2012 Link to this post

    I am having a similar issue with trying to filter my grid client side when the json result for the column is a decimal.
  3. Paul
    Paul avatar
    8 posts
    Member since:
    Jan 2012

    Posted 10 Mar 2014 Link to this post

    Has this been solved yet? I am experiencing this problem with filtering a datasource on an integer field.
  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 13 Mar 2014 Link to this post

    Hello,

    It is expected have the error in the described scenario. When you sing filter expressions there are two thing that you must validate before applying it to the DataSource:
     - the operator is valid, i.e has meaning for the target type. It doesn't make sense of using `contains` for `numeric` types.
     - the value of the expressions is converted to the target type, i.e `searchText` must be number / parseInt(searchText, 10)

    Regards,
    Nikolay Rusev
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top