通过javascript进行Kendo UI网格过滤无法正常工作

时间:2014-09-16 12:16:48

标签: javascript jquery kendo-ui

我正在使用kendo UI网格视图。

数据是

subNodesArray = "one", "two", "three", "four", "five", "[15] OTU2-XP(59.79)(55.75) -B", "[16] GE-XPE(57.36)(*)-B*"]


var grids = $('#alarmsGrid').data('kendoGrid');
    for(var i=0; i<subNodesArray.length;i++){
        console.log(subNodesArray[i])
        grids.dataSource.filter({
            "logic":"or",
            "filters":[
                { field: "sourceId", operator: "eq", value: subNodesArray[i] },
            ]
        });
    }

此处过滤对我不起作用。

1 个答案:

答案 0 :(得分:0)

var subNodesArray = ["one", "two", "three", "four", "five", "[15] OTU2-XP(59.79)(55.75) -B", "[16] GE-XPE(57.36)(*)-B*"];

var filters = [];
for(var i=0; i<subNodesArray.length;i++){
    filters.push({ field: "sourceId", operator: "eq", value: subNodesArray[i] });
}
$('#alarmsGrid').data('kendoGrid').dataSource.filter({
    "logic":"or",
    "filters":filters
});