我在剑道网格中的列上有两个值:Part和Subpart,我想在下拉列表中添加这两个值,并希望基于下拉列表的选择来过滤网格。我试过了:-
{
field: "PartType",
title: "Part Type",
width: 10,
headerAttributes: { style: "text-align:center" },
attributes: { style: "text-align:left" },
filterable: {
cell: {
operator: "contains",
template: function (args) {
// create a DropDownList of unique values (Active)
args.element.kendoDropDownList({
dataTextField: "PartType",
dataValueField: "value",
dataSource: args.Active = new kendo.data.DataSource({
data: [{ PartType: "Part", value: "Part" }, { PartType: "SubPart", value: "SubPart" }]
}),
index: 0,
optionLabel: {
PartType: "All",
value: ""
},
valuePrimitive: true
});
}
}
}
},