我已经使用kendo网格创建了一个用户管理网格,如您在图像中看到的 在使用列模板输入多个值后,它在单个单元格中具有多个值,我无法过滤“角色”列
任何人都可以举个例子在列中插入多个值并使过滤器启用并工作。
下面的示例代码
$("#user-Grid").kendoGrid({
dataSource: {
data: userListAll,
pageSize: 10,
schema: {
model: {
id: "id",
fields: {
userName: { validation: { required: true },type: "string" },
firstName: { validation: { required: true },type: "string" }
}
}
}
},
//toolbar: ["create"],
//height: 450,
scrollable: false,
sortable: true,
pageable: {
pageSizes: true,
buttonCount: 5
},
filterable: true,
reorderable: true,
//columnMenu: true,
editable: {
mode: "popup",
template: kendo.template($("#user_editor").html()),
confirmation: false,
width: 450,
},
save: function(e) {
},
edit: function(e) {
//console.log(e.model)
},
dataBound: function(e) {
console.log("dataBound");
},
filterable: {
extra: false,
operators: {
string: {
startswith: "Starts with",
eq: "Is equal to",
neq: "Is not equal to"
}
}
},
//filterable: { mode: "row" },
columns: [{
field: "userName",
title: "User Name",
width: 240,
filterable: {
multi: true,
search: true
}
}, {
field: "firstName",
title: "First Name",
filterable: {
multi: true,
search: true
}
}, {
field: "lastName",
title: "Last Name",
filterable: {
multi: true,
search: true
}
}, {
field: "email",
title: "Email",
filterable: {
multi: true,
search: true
}
}, {
field: "roles",
title: "Role",
template: "#=generateTemplateRole(roles)#",
},{
command: ["edit"],
title: " ",
width: "150px"
}],
});