gpt4 book ai didi

javascript - Kendo 源过滤器不起作用

转载 作者:行者123 更新时间:2023-12-03 11:45:43 25 4
gpt4 key购买 nike

在这里,我的过滤器不起作用。当代码将数据发送到 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com