剑道网格过滤器在现场通过

时间:2015-09-28 08:09:29

标签: javascript jquery kendo-ui kendo-grid

我有:

{
                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());

0 个答案:

没有答案