KendoUI Network - Disable some filter statements per column

I want to disable (or maybe define some kind of custom list) statements per column. I tried to do this in column definitions:

"field": "Name", "title": "name", "attributes": { "class": "nameCell" }, "filterable": { "operators": gridTranslationService.getHierarchyOperators() } 

But this does not work for me. Any suggestions how can I do this?

+5
source share
1 answer

Define the 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> 
+10
source

Source: https://habr.com/ru/post/1208022/


All Articles