剑道网格:如何禁用"过滤"在数据列定义?

时间:2016-09-06 21:00:47

标签: javascript html kendo-ui kendo-grid

我已使用data-columns属性以声明方式定义了一个kendo网格。有些列定义了"filterable": ...属性,而有些列则没有。未定义它的那些仍显示过滤器文本框,其中包含所有选项"等于","以"开头等等。

我希望在这些我没有定义属性的列上根本没有过滤器文本框。

如何明确删除过滤器文本框?

我的网格定义:

<div id="Checkpoints">
    <div data-filterable='{ "mode": "row" }'
         data-role='grid'
         data-sortable='true'
         data-bind='source: reportData.CheckpointExceptions'
         data-pageable='{ "pageSize": 10 }'


         data-toolbar='["excel"]'
         data-excel='{ "fileName": "CheckpointExceptionExport.xlsx", "allPages": "true" }'
         data-excelExport='e -> excelExportHelper(e)'

         data-columns='[
            {
                "field": "checkpoint_name", 
                "title": "Checkpoint", 
                "filterable": { "cell": { "operator": "contains"}}},
            {
                "field": "location_name", 
                "title": "Location", 
                "filterable": { "cell": { "operator": "contains"}}
            },
            {
                "field": "patrolled_by", 
                "title": "Patrolled By", 
                "filterable": { "cell": { "operator": "contains"}}
            },
            {
                "field": "geotag",
                "title": "GeoTag", 
                "template": kendo.template($("#geotagTemplate").html()) 
            },
        {
            "field": "geofence",
            "title": "GeoFence",   
            "template": kendo.template($("#geofenceTemplate").html())
        },
        {
            "field": "completed",
            "title": "Completed",
            "template": kendo.template($("#completedTemplate").html())
        },
        {
            "field": "gps",
            "title": "GPS", 
            "template": kendo.template($("#gpsTemplate").html())
        },
        {
            "title": "", 
            "template": kendo.template($("#viewLinkTemplate").html())
        }
    ]'>
</div>

1 个答案:

答案 0 :(得分:2)

为您不希望过滤的字段声明filterable属性,然后明确将其设置为false,就像在this jsFiddle中完成一样。