我有:
{
headerTemplate: 'Email invoices',
field: 'email_invoices',
filterable: {
ui: gridFunctions.yesNoFilterUI.bind(activeGrid),
extra: false
}
},
过滤器UI定义为:
define(['jquery', 'kendo', 'util/addMenu', 'config'], function ($, kendo, addMenu, config) {
var obj = {
...
yesNoFilterUI: function (e) {
var that = this;
e.kendoDropDownList({
dataSource: [
{
"id": "1",
"text": "Yes"
},
{
"id": "0",
"text": "No"
}
],
optionLabel: "Select yes/no",
dataTextField: "text",
dataValueField: "id",
change: function (e) {
obj.setInternalFilter(that, 'yesNo', 'eq', this.value());
}
});
},
...
}
return obj;
})
列过滤器'yesNo'
错误,这需要是包含字段名称的变量,即email_invoices。
我如何按照以下方式获取或传递:
obj.setInternalFilter(that, field, 'eq', this.value());