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

Filter datasource does not filter!

1 Answer 158 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
morteza
Top achievements
Rank 1
morteza asked on 27 Aug 2018, 07:41 AM

Hello,

 

I get data from ajax call,i have two fields which are Boolean   and want to apply the filter on these two fields:

 

  $.ajax({
          dataType: "json",
          type: "POST",
          url: "@Url.Action("fnction", "Dashbrd")",
          contentType: "application/json; charset=utf-8",
          data: JSON.stringify({ "regionalManager": dtDrpVals.drpValue, "dtFrom": dtDrpVals.fromDate}),
          success: function (result) {
          var dataSource = new kendo.data.DataSource({
          data:result,      
          filter:[{
         "logic": "and",
         "filters": [{
         "field": "m_grid",
         "operator": "eq",
         "value": false},
         {"field": "crew_present",
          "operator": "eq",
          "value": false}]},]      
      });

 

the result has 40 records,if the filter i set works,must give me 10 records

1 Answer, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 28 Aug 2018, 10:49 AM
Hello,

You could use the view() method in order to get the filtered data. 
In the Dojo example linked here there the two boolean fields as from the provided snippet. When you run the example the filtered data will be console logged (screencast). 

Regards,
Neli
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
Data Source
Asked by
morteza
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or