Dear all how can we use nested data tables up to 3 levels.
Dear all how can we use nested data tables up to 3 levels.
anuragvksharma
Posts: 2Questions: 1Answers: 0
I have to show drill down tables,thus i have to show parent table-nested table 1- nested table 2.
How can we do this using data tables.The nested table will be populated on basis of any field selected on parent table.
when click on parent table button nested table 1 populate,when click on nested table 1 button nested table 2 populates.
Please help me to get this.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Just use the
row().child
to create child rows, you can expand/hide them, heres an exampleIn the content of the child row, you can insert another table, and just initialize DataTables when the child rows are shown.
I created an example with just two levels.. I figure ill leave the 3rd level all to you. To expand the rows, just click on the empty cell to the far left of the initial table, in the column with the header titled +/-
Tip: Since you're going to be initializing and re-initializing DataTables when the child rows are expanded, make sure you set
retrieve
to true, so it wont throw an error saying you cant re-init the same datatables... Optionally, you can usedestroy
, but I dont recommend that, unless you know its needed.Thanks jLinux for your help.