Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child expand/collapse state not saved #115

Closed
denzelby opened this issue Mar 12, 2015 · 3 comments
Closed

Child expand/collapse state not saved #115

denzelby opened this issue Mar 12, 2015 · 3 comments

Comments

@denzelby
Copy link

Hello,

It seems that 'expand/collapse' state of childs are not saved beetween data modifications/filtering/etc with griddle+subgrids.
So, for example, we have some hierarchical data, user expand some parent rows. Then data update is triggered - grid rerenders, all parent rows resets to 'collapsed' state.
The same story with filtering, please take a look at example: http://jsfiddle.net/zcpf1gfs/
How to reproduce (using jsfiddle above):

  1. open dev console;
  2. expand all/some rows;
  3. start typing in 'Filter' box, for example: "Child".
    Actual result: all parent rows collapse, error thrown ("Invariant Violation: findComponentRoot(..., .0.1.2.0.0.0.3.0.0.0.0.1.0): Unable to find element...")

Am I right or just missed some configuration options? If so, can we have some fix or workaround for this? Maybe the #104 is the reason?

Thanks in advance and best regards, really appreciate your work with Griddle.

@sehcheese
Copy link

Any progress here? This issue still exists for me.

@apalanki
Copy link

apalanki commented Sep 23, 2016

I know this is an year old but if some one is still looking for answer, this is how I implemented it.

  1. In griddle.jsx.js, while creating GridTable, add this prop to
    that list on line 836: resultsFromFilter: !this.isNullOrUndefined(this.state.filteredResults)
  2. In gridTable.jsx.js, add "resultsFromFilter": false to default pass down resultFromFilter prop while creating GridRowContainer on line 180: resultsFromFilter: that.props.resultsFromFilter
  3. In gridRowContainer.jsx.js, add resultsFromFilter: false to list of default props and add this function to component. componentDidMount(){this.setState({showChildren:this.props.resultsFromFilter})}.

This will ensure that when ever the sub grid matches the result comes out as un-collapsed.

@ryanlanciaux
Copy link
Member

Closing this one for now -- with the latest structure, expand / collapse should be handled as a plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants