Skip to content
Snippets Groups Projects
Commit 41ddc8ad authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

ExtJS 4.2: Modify the reset mechanism for grid (to be imporved).

parent 897b463d
No related branches found
No related tags found
No related merge requests found
......@@ -65,8 +65,9 @@ Ext.define('App.grid.Grid', {
},
/**
* Reset the grid.
* The store is load with fresh data and the event *resetgrid* is fired.
* Reset the grid by removing filtering conditions
* and by loading fresh data when the store is buffered.
* TODO: duplicate with gridfilter.onReset. Improve it.
*
*/
reset: function () {
......@@ -75,13 +76,17 @@ Ext.define('App.grid.Grid', {
var store = this.getStore();
store.restoreWhere();
if (store.buffered) {
if (this.getStore().buffered) {
store.restoreWhere();
store.data.clear(true);
store.loadPage(1);
} else {
store.load();
store.clearFilter();
store.filter();
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment