Yuu
Yuu

Reputation: 619

Client side Kendo Grid Filtering

I'm trying to accomplished a Client side Kendo Filtering in fact I already did the single condition but when I try to make this in multiple conditions it will just load all data in Kendo Grid

Here's my code :

function searchAccount() {
             var SearchProgramData = $("#SearchAccountData").val();
             $("#grAccount").data("kendoGrid").DataSource({
                 filter:{
                     logic:'or',
                     filter:[
                     {
                         field: "account_desc",
                         operator: "contains",
                         value: SearchProgramData
                     },
                     {
                         field: "ChildAccountCode",
                         operator: "contains",
                         value: SearchProgramData
                     }
                     ]
                 }

             });

         }

Upvotes: 1

Views: 2133

Answers (1)

Björn
Björn

Reputation: 3418

I think you just need to add an "s" to the inner "filter":

function searchAccount() {
         var SearchProgramData = $("#SearchAccountData").val();
         $("#grAccount").data("kendoGrid").dataSource({
             filter:{
                 logic:'or',
                 filters:[
                 {
                     field: "account_desc",
                     operator: "contains",
                     value: SearchProgramData
                 },
                 {
                     field: "ChildAccountCode",
                     operator: "contains",
                     value: SearchProgramData
                 }
                 ]
             }

         });

     }

Edit: I have updated DataSource to dataSource as FrostyPinky pointed out in the comment.

Upvotes: 1

Related Questions