javascript - How can I iterate through an object array and place values into a filter? -


i using kendo ui grid show data. able filters want use in object array

object {logic: "and", filters: array[3]} filters:array[3] 0:object     field:"checkdate"     operator:"gte"     value:fri jan 01 2016 00:00:00 gmt-0500 (eastern standard time) 1:object     field:"checkdate"     operator:"lte"     value:tue jan 31 2017 00:00:00 gmt-0500 (eastern standard time) 

what can't figure out how loop through array , use values inside of filter kendo grids. filter code looks this:

   grid.datasource.filter({             logic: "and",             filters: [             { field: "employeename", operator: "contains", value: val }         ]     }); 

i'd have make line each item in array apply filters.

are asking for ... in statement? if order not important, use that.

for (var val in yourobject.filters){    grid.datasource.filter({             logic: "and",             filters: [             { field: val[0], operator: val[1], value: val[2] }         ]     }); }; 

reference: https://developer.mozilla.org/en-us/docs/web/javascript/reference/statements/for...in


Comments