react-redux-grid icon indicating copy to clipboard operation
react-redux-grid copied to clipboard

tree view: Is there a way set if a parent node should be initially expanded?

Open laurenga opened this issue 7 years ago • 2 comments

I really like the tree view in the grid. Though I'd like a way to choose if the parent nodes are expanded when the grid is loaded. Is there a way to do this already? What about a way to expand/collapse the tree structure programmatically?

laurenga avatar Feb 02 '18 02:02 laurenga

I feel like I've seen example of this kind of behavior -- perhaps @Vanderslice may have some insight here.

bencripps avatar Feb 04 '18 02:02 bencripps

Found out how: just add _hideChildren: true as a field on the tree-data entry whose children should be collapsed.

Example:

const treeEntry = {
  name: "some name",
  children: [
    {name: "other name},
  ],
  _hideChildren: true
};

Venryx avatar Apr 20 '20 03:04 Venryx