【发布时间】:2020-11-18 02:01:52
【问题描述】:
这是我的 KendoGrid:
$scope.gridEltCompoOptions = {
dataSource: {
transport: {
...
},
schema: {
model: {
id: 'IdElement',
fields: {
GroupeActes: { defaultValue: { IdGroupeActes: null, Libelle: ' ' } }
}
}
}
},
sortable: true,
resizable: true,
filterable: {
mode: 'row'
},
columns: [{
field: 'GroupeActes',
title: "Groupe d'actes",
template: function (dataItem) {
return kendo.toString(dataItem.GroupeActes.Libelle);
}
}, ]
我想在属性 Libelle 上过滤我的字段“GroupeActes”(GroupeActes 是一个对象),但实际上过滤器采用了整个对象。
当我尝试过滤时,我有一个 Js 错误
未捕获的 TypeError: (d.GroupeActes || "").toLowerCase 不是函数
问题很清楚,过滤器正在获取整个对象,而不是属性 Libelle。 我过去 4 小时尝试了我在谷歌上找到的所有解决方案,但没有任何效果
我的对象 GroupeActes 是这样的: var GroupeActes = { 集团行动:{ 利贝尔:“” } } 有两个 groupeActes 级别
我在 2015 年看到一个管理员的帖子,说这种过滤器是不可能的, 但我也看到了这种解决方案: https://docs.telerik.com/kendo-ui/knowledge-base/grid-filter-column-with-dropdownlist
(if(e.field == "Category" && e.filter !== null){) 在示例中 我试图做类似的事情:如果字段==“groupeActes”=>所以我想过滤Libelle属性, 但我没有成功
有人可以帮帮我吗?
非常感谢
【问题讨论】:
标签: filter kendo-ui kendo-grid