在这里,我的过滤器不起作用。当代码将数据发送到 Controller 时,我收到以下错误。
错误:
An unknown function with name 'contains' was found. This may also be a key lookup on a navigation property, which is not allowed.
代码:
$("#btnSearch").click(function () {
txt = $("#Where").val();
filter = "contains(Title,'"+txt+"')";
return db.cards('content', page || 1, null, filter).then(function (d) {
vm.widgetData.records(d);
});
});
最佳答案
我假设 db.cards 是您的一个模块,但格式良好的过滤器如下所示:
var filter= { field: "Title", operator: "contains", value: txt };
datasource.filter(filter);
运算符包含存在:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-filter.operator
关于javascript - Kendo 源过滤器不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26060351/