我有一个listgrid,它有一个自定义列 PermissionLevel 来说明列值的值。我想让用户能够过滤。所以..
filterEditorType
设置为“SelectItem”我不确定如何从这里开始。我想如果我设置filterEditorValueMap
以便它会在值列中搜索值,那么它将按照我想要的方式工作,但到目前为止还没有运气。也许我只是不知道如何设置filterEditorValueMap
提前致谢@claudiobosticco:)
答案 0 :(得分:1)
实际上你提供了很少的上下文,比如网格的代码和/或你需要的过滤器外观的完整模型。
但是,如果我理解你的用例,这样的样本可能适合它:
isc.ListGrid.create({
ID: "countryList",
width: 500, height: 300, alternateRecordStyles: true,
dataSource: worldDS,
fields: [
{
type: "image", imageURLPrefix: "flags/16/", imageURLSuffix: ".png",
name: "countryCode", title: "Code", width: 50,
filterEditorType: "SelectItem",
filterEditorValueMap: {"US": "US", "CA": "CA"},
filterEditorProperties: {
formatValue: function (value, record, form, item) {
return form.imgHTML("flags/16/" + value + ".png")
},
pickListFields: [
{name: "countryCode", type: "image", imageURLPrefix: "flags/16/", imageURLSuffix: ".png"}
]
}
},
{name: "countryName", title: "Country"},
{name: "capital", title: "Capital"},
{name: "continent", title: "Continent"}
],
autoFetchData: true,
showFilterEditor: true
})
您可以将其粘贴到SmartClient showCase示例中,例如filterSample