I want to disable (or maybe define some custom list of) operators per column. I tried to do this in columns definitions:
"field": "Name",
"title": "name",
"attributes": {
"class": "nameCell"
},
"filterable": {
"operators": gridTranslationService.getHierarchyOperators()
}
But it not works for me. Any sugestions how can I do that ?
Set status
column definition as:
columns: [
{
field: "status",
filterable: {
operators: {
string: {
eq: "Equal to",
neq: "Not equal to"
}
}
}
},
$(document).ready(function() {
$("#grid").kendoGrid({
columns: [
{ field: "id", filterable: false },
{
field: "status",
filterable: {
operators: {
string: {
eq: "Equal to",
neq: "Not equal to"
}
}
}
}
],
filterable: true,
dataSource: [
{ status: "error", id: 1 },
{ status: "warning", id: 2 },
{ status: "warning", id: 3 },
{ status: "warning", id: 4 }
]
});
});
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.default.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.3.1119/js/kendo.all.min.js"></script>
<div id="grid"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With