【问题标题】:Filter data with duplicate record in kendoTreeList在 kendoTreeList 中过滤具有重复记录的数据
【发布时间】:2019-08-14 09:51:32
【问题描述】:

在 KendoJqueryTreelist 中,当使用 Contains 过滤数据时,不显示重复记录

在 KendoJqueryTreelist 中,当使用包含过滤数据时不显示重复记录,但我需要在 kendo jquery 树列表中显示包含(包括重复记录)的所有记录。按姓氏过滤

"<script>

  $("#treeList1").kendoTreeList({
    columns: [
      "lastName",
      "position"
    ],
    filterable: true,
    dataSource: {
      data: [
        { id: 1, parentId: null, lastName: "Jackson", position: "CEO" },
        { id: 2, parentId: 1, lastName: "Weber", position: "  VP, Engineering" },
        { id: 1, parentId: null, lastName: "Jackson", position: "CEO" },
        { id: 4, parentId: 1, lastName: "Weber", position: "  VP, Engineering" }
      ]
    }
  });


</script>"

【问题讨论】:

  • 你能发布一个可执行的例子吗?

标签: kendo-ui kendo-treeview kendo-treelist


【解决方案1】:

Telerik/Kendo 从不喜欢几乎所有组件都有重复的 id 中断,如果使用“employee-id”,我会在服务器端为每一行生成一个唯一的 id 并添加一个新列:

$("#treeList1").kendoTreeList({
 columns: [
  "lastName",
  "position"
 ],
filterable: true,
dataSource: {
  data: [
    { id:1, employeeId: 1, parentId: null, lastName: "Jackson", position: "CEO" },
    { id:2, employeeId: 2, parentId: 1, lastName: "Weber", position: "  VP, Engineering" },
    { id:3, employeeId: 1, parentId: null, lastName: "Jackson", position: "CEO" },
    { id:4, employeeId: 4, parentId: 1, lastName: "Weber", position: "  VP, Engineering" }
  ]
}
});
</script>"

【讨论】:

    猜你喜欢
    • 2020-02-18
    • 2012-06-07
    • 2015-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-25
    • 1970-01-01
    • 2021-07-17
    相关资源
    最近更新 更多