从下拉列表中过滤剑道网格列

时间:2018-07-30 14:00:10

标签: kendo-ui

我在剑道网格中的列上有两个值: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

                                              });

                                          }
                                      }
                                  }
                              },

0 个答案:

没有答案