0

在 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>"
4

1 回答 1

0

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>"
于 2019-09-05T10:03:27.847 回答