How to know if Tabulator table row is expanded?

Viewed 237

How can I determine if a tree row in Tabulator is expanded or collapsed? I'm using version 4.9, the current. The best I could come up was digging into the implementation details:

row._row.modules.dataTree.open

But I'd prefer something using only the documented API. The best I could come up with was:

row.getNextRow().getTreeParent() === row
// (With special handling when getNextRow() is false)
1 Answers

I don't think there is currently a built-in method to check expanded state. You could row.getElement() and manually check for the dataTreeCollapseElement. You can also create a Github Issue to suggest the addition of one.

You are right to avoid referencing _row, as any properties beginning with an underscore are to be treated as private properties. These are undocumented and could change at any time, and aren't meant to be referenced outside Tabulator's source code.

Related