0

Is there a way with Tabulator to filter a tree table based on the leaf children? I tried with different parameters from the documentation with no luck.

I have created a codepen to illustrate the problem. Basically if I put Child I would expect the Parent node to remain since it still have a child.

 var tabletree = new Tabulator("#tabletree_2684551008384", Object.assign({}, 
 {layout: "fitColumns", columns: [{field: "name", title: "name", headerFilter: "input"},
 {field: "progress", title: "progress"}], selectable: false, dataTree: true, dataTreeStartExpanded: false, movableColumns: false, 
 data: [{"name": "Parent Node 1", "_children": [{"name": "Child A", "progress": 767860}, {"name": "Child B", "progress": -2877980}]}]}))

my code

Thanks.

Marwen Jaffel
  • 703
  • 1
  • 6
  • 14
Epykure
  • 1
  • 2
  • I manage to find a workaround by creating a bespoke headerFilterFunc. Add a comment if you are interested in seeing the code. – Epykure May 06 '21 at 08:13
  • Here is a recursive implementation that will do the job: https://stackoverflow.com/a/68155905/7576114 – David Fiaty Jun 28 '21 at 03:56

0 Answers0