bencripps / react-redux-grid

A React Grid/Tree Component written in the Redux Pattern
http://react-redux-grid.herokuapp.com/
MIT License
444 stars 63 forks source link

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

Open laurenga opened 6 years ago

laurenga commented 6 years ago

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?

bencripps commented 6 years ago

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

Venryx commented 4 years ago

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
};