-
Notifications
You must be signed in to change notification settings - Fork 9
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
Enable grid state, Fixes #314 #331
Conversation
admin/tabs/configs/ConfigPanel.js
Outdated
colChooserButton({gridModel}), | ||
button({text: 'GroupBy Type', onClick: () => gridModel.setGroupBy('valueType')}), | ||
button({text: 'Clear Grouping', onClick: () => gridModel.setGroupBy(null)}) | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All code in config panel is for Demo purposes, remove before merge.
cmp/grid/GridStateModel.js
Outdated
}).finally(() =>{ | ||
this._resetting = false; | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this method needs to be async. It is in Hoist-Sencha, but I think that maybe for a db based override to loading/reseting state. Not sure if we want to prepare for that now or keep it simpler for the moment.
cmp/grid/GridStateModel.js
Outdated
//-------------------------- | ||
saveStateChange = debounce(function() { | ||
this.saveState(this.getStateKey(), this.state); | ||
}, 5 * SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Hoist-Sencha we check for the state object and whether or not we are resetting. I think we should always have a state object (even if it's empty).
As far as resetting, I think if we keep the asynchronous state reset we should check for it, but if we make that operation synchronous it's probably unnecessary.
cmp/grid/ColChooser.js
Outdated
@@ -32,6 +32,12 @@ export class ColChooser extends Component { | |||
item: leftRightChooser({model: lrModel}) | |||
}), | |||
toolbar( | |||
button({ | |||
text: 'Reset', | |||
icon: Icon.refresh({cls: 'xh-red'}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note hoist-react develop branch just recently got an undo icon we should use here.
Opening for review, contains test/demo code that must be removed before merge (5/30/18)