James Wierzba James Wierzba - 1 year ago 94
HTML Question

Kendo Grid: How to disable "filterable" on data-column definition?

I have defined a kendo grid declaratively with a

attribute. Some columns have a
"filterable": ...
attribute defined, and some don't. The ones that do not have it defined still show the filter textbox with all of the options "Equal to", "Starts with", ... etc.

I would like to have no filter textbox at all on these columns for which I've not defined the attribute.

How can I explicitly remove the filter textbox?

My grid definition:

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

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

"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())

Answer Source

Declare the filterable property for the fields you do not want to be filterable, then explicitly set it to false, as it's done in this jsFiddle.