Griddle supports subgrids . I have a custom component (used to select a row) in one of the fields that changes state. This change in state causes a re-visualization that destroys the subcrisis. However, I would like it to remain open.
The same problem is described in this Github issue , including this example (thanks to @denzelby Github), in which filtering collapses subgrids.
Pay attention to the code from the script how the state of onCountClick updated (pressing the "inc" button), causing a repeated visualization:
var GridAndCounter = React.createClass({ render: function() { var columnNames = ['id', 'age', 'name', 'company', 'state', 'country', 'favoriteNumber']; var rowMetadata = {key: "id"}; return <div><Counter count={this.state.count} onClick={this.onCountClick} /><Griddle results={fakeData} rowMetadata={rowMetadata} columnNames={columnNames} resultsPerPage={100} showFilter={true} /></div> }, onCountClick: function() { React.addons.Perf.start(); this.setState({count: this.state.count + 1 }); setTimeout(function() { React.addons.Perf.stop(); React.addons.Perf.printDOM(); }, 500); }, getInitialState: function() { return { count: 0 }; } })
This status update triggers a re-render, which causes everything to collapse. How can I save everything I need for re-rendering? Perhaps I could keep track of which ones are expanded, but then I need a programmatic way to expand rows that I did not find with Griddle.
javascript reactjs griddle
Scott h
source share