我对 Kendo UI 有疑问。我无法过滤某些列。
这是一个 plunker在我的示例中,我尝试过滤列 id、prog 或 Max Temps,但它不起作用。
<body>
<div id="grid"></div>
</body>
<script>
$("#grid").kendoGrid({
dataSource: [
{ id: 36308, reportDate: "2015-02-01", prog: 58, state: "Waiting", maxTemps: 0 },
{ id: 36309, reportDate: "2015-02-01", prog: 34, state: "Complete", maxTemps: 86400 },
{ id: 36310, reportDate: "2015-02-01", prog: 116, state: "Complete", maxTemps: 86400 },
{ id: 36311, reportDate: "2015-02-02", prog: 58, state: "Complete", maxTemps: 86400 }
],
filterable: true,
columnMenu: true,
columns: [
{ field: 'id', title: 'Id', width: '80px' },
{ field: 'reportDate', title: 'Report Date', width: '100px' },
{ field: 'prog', title: 'Prog', width: '60px' },
{ field: 'state', title: 'Status', width: '130px' },
{ field: 'maxTemps', title: 'Max Temps', width: '100px' }
]
});
</script>
我在 Chrome 上遇到这个错误:
Uncaught TypeError: (d.prog || "").toLowerCase is not a function
这是 Firefox 上的:
TypeError: "".toLowerCase is not a function.
我认为这是因为我的数据类型在这些列上是整数。我不知道如何解决这个问题。有什么想法吗?
最佳答案
您需要定义类型号码,这样号码过滤就不会出现任何问题。引用下面代码
columns: [
{ field: 'prog', type:'number', title: 'Prog', width: '60px' },
]
关于javascript - kendo ui 网格过滤器不适用于整数类型的列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29346616/