gpt4 book ai didi

kendo-ui - KendoUI 网格 - 每列禁用一些过滤器操作符

转载 作者:行者123 更新时间:2023-12-04 17:18:39 24 4
gpt4 key购买 nike

我想禁用(或可能定义一些自定义列表)每列的运算符。
我试图在列定义中这样做:

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

但它对我不起作用。任何建议我该怎么做?

最佳答案

套装status列定义为:

    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>

关于kendo-ui - KendoUI 网格 - 每列禁用一些过滤器操作符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27226273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com