为kendo日期列启用额外过滤器

时间:2014-08-31 06:49:37

标签: jquery kendo-ui kendo-grid filtering

您好我有一个4列的剑道网格,其中一列是日期类型。

我想为日期类型列显示额外的过滤器选项。以下是我的踪迹。

var grid = $("#mygrid").kendoGrid({
            sortable: true,
            pageable: true,
            scrollable: true,

            filterable: {
                extra: true,
                operators: {
                    string: {
                        startswith: "Starts with",
                        eq: "Is equal to",
                        neq: "Is not equal to",
                        contains: "Contains"
                    },

                    date: {
                        eq: "Is equal to",
                        neq: "Is not equal to",
                        gte: "Is after or equal to",
                        gt: "Is after",
                        lte: "Is before or equal to",
                        lt: "Is before",
                    }

                }
            },

当我说额外的:true时,它适用于所有列。但我不想为字符串类型列显示额外的过滤器。如何为日期列启用额外的:true?

由于

1 个答案:

答案 0 :(得分:1)

您也可以在extra中定义Columns.filterable

示例:

$("#grid").kendoGrid({
    dataSource: [
        { name: "Jane Doe", age: 30 },
        { name: "John Doe", age: 33 }
    ],
    filterable: {
        extra: false
    },
    columns: [
        { field: "name" },
        { field: "age", filterable: { extra: true} }
    ]  
});

这定义了默认情况下它应该extra使用false 作为age列,它将是true

在此处运行示例:http://jsfiddle.net/OnaBai/fyje2c1g/