T
TanStack3y ago
fascinating-indigo

Does subRows have to be the same type as row?

I'm looking to add more context to a row by having it open sort of like in the image. However, as far as I can tell the lib seems to indicate that the type of subrow must be the same type as the row. Is there any way to make a "nested group"? Cheers
No description
3 Replies
dependent-tan
dependent-tan3y ago
Subrows are meant to be rows just nested under a different row, they are important because they have to match stuff like column widths. Yours is really just an entire new table under the row with its own columns and own widths and what not. Look into the subcomponent example instead IMHO.
fascinating-indigo
fascinating-indigoOP3y ago
Well I think that answers my question then! I've already seen the example and I managed to get it running in vue + I've tested a bit but I just wanted to make sure. Do you think this sort of feature could be supported in the future?
harsh-harlequin
harsh-harlequin2y ago
I'm in a similar scenario where my nested row will be of a different data type than the original one. Looking at the sub components example at: https://tanstack.com/table/v8/docs/framework/react/examples/sub-components I still see that subRows is the same type as the root/original row. Did using sub components address your use-case of having a nested row of a different type? If not, what did you have to do?
React Table Sub Components Example | TanStack Table Docs
An example showing how to implement Sub Components in React Table

Did you find this page helpful?