2

I have a material-table component where I am rendering a nested materiel-table in the detail panel of each row. I would like to know if there is a way to include detail panel material-table rows in the functions offered by the package. I am mainly interested in the selection feature for now, but will likely need the same support for other functions like filtering, search, etc...

Now I know that Tree Data allows this since all rows are part of the same table. But I need to be able to do it with using the Detail Panel.

NB: For more clarity, here is a code sandbox I found with the nested table functionality.

So how would one go about adding their custom select function to a material-table, such as to include selected rows inside nested material-tables ?

Sirkow
  • 63
  • 9
  • I don't fully understand what is the matter here: do you want to add a selection feature to the outer table? So that when you select a row in the outer table the rows in the inner table would be selected too? – Iorweth333 Apr 27 '22 at 15:38
  • Yes, that is correct. – Sirkow Apr 28 '22 at 18:51

1 Answers1

1

The way to control the row checked state outside of the table, meaning without using the provided check box inputs, is demonstrated in a demo created after I asked the same question in the material-table-core repo. It's pretty straight forward and should help anyone trying to do the same : https://material-table-core.com/demos/selection/outside-of-table/

coderdonezo
  • 399
  • 1
  • 12