Filter data with duplicate record in kendoTreeList

379 views Asked by At

In KendoJqueryTreelist, when filter data using Contains then duplicate record is not show

In KendoJqueryTreelist, when filter data using Contains then duplicate record is not show, But i require to show all record that contains(Including duplicate record) in kendo jquery treelist. filter by last name

"<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>"
1

There are 1 answers

0
Jörgen Moen On

Telerik/Kendo never likes to have duplicate id's breaks almost all of their components, I would on the server side generate a unique id for every row and add a new column if "employee-id" is used:

$("#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>"