对我来说简单而困难。如果基于 FileCategory 过滤器类别名称,我只想将过滤器应用于网格。假设我想为类别名称为 Central Supply 的项目过滤网格。这是数据,也是我的尝试。在我的尝试中,我展示了过滤器适用于属性(单个值),但我不能让它适用于集合。
Data: [
-{
Id: 1
FileName: "MyFile"
RevisionDate: "2013-01-08T00:00:00"
FormNumber: "MyFormName"
FormTitle: "aa"
Class: "a"
SecondaryCategory: "a"
UploadDate: "2013-01-11T08:34:46.677"
-FileCategoryFilter: [
-{
FileCategoryId: 1
CategoryName: "Administrative Manual Docs"
Active: true
File: null
}
-{
FileCategoryId: 4
CategoryName: "Central Supply"
Active: true
File: null
}
]
}
Kendo Grid 服务器包装器
.Filter(filters =>
// { filters.Add(p => p.FileName).IsEqualTo("Central Supply");})
//this filter works for a property but I havent figured out how to do a collection.
{
filters.Add(
p =>p.FileCategoryFilter.Select(i=>i.CategoryName).Contains("Central Supply")
);
})