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

Kendo Grid Filtering at client Side Issue

3 Answers 232 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 18 Sep 2012, 07:05 AM
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.

3 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 31 Oct 2012, 08:28 PM
I am having a similar issue with trying to filter my grid client side when the json result for the column is a decimal.
0
Paul
Top achievements
Rank 1
answered on 10 Mar 2014, 10:31 PM
Has this been solved yet? I am experiencing this problem with filtering a datasource on an integer field.
0
Nikolay Rusev
Telerik team
answered on 13 Mar 2014, 02:10 PM
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.

 
Tags
Grid
Asked by
Sunny
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or