diff --git a/static/plugin_dbui/src/grid.js b/static/plugin_dbui/src/grid.js index a7edcd416f3420dcb0b020f89cf92680b2568354..2f473262c820853fa2e90be6d2135e5a9effe88c 100644 --- a/static/plugin_dbui/src/grid.js +++ b/static/plugin_dbui/src/grid.js @@ -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(); } + } });