How to override update action in PagingToolbar

I need to write some action based on the refresh button on the paging toolbar. How can I override the doRefresh() method?

 this.bbar=Ext.create('Ext.PagingToolbar', { store: store, displayInfo: true, displayMsg: 'Displaying records {0} - {1} of {2}', emptyMsg: "No topics to display" }); 
+6
source share
2 answers

If you just want to do this, use

 Ext.create('Ext.PagingToolbar', { store: store, displayInfo: true, displayMsg: 'Displaying records {0} - {1} of {2}', emptyMsg: "No topics to display", doRefresh : function(){ // Keep or remove these code var me = this, current = me.store.currentPage; if (me.fireEvent('beforechange', me, current) !== false) { me.store.loadPage(current); } } }); 

or for all page panels.

 Ext.PagingToolbar.prototype.doRefresh = function() { // Keep or remove these code var me = this, current = me.store.currentPage; if (me.fireEvent('beforechange', me, current) !== false) { me.store.loadPage(current); } } 

Please note: if you do this, you need to double check it every time you update the EXTJS kernel to ensure functionality!

+10
source
 Ext.create('Ext.PagingToolbar', { store: store, displayInfo: true, displayMsg: 'Displaying records {0} - {1} of {2}', emptyMsg: "No topics to display", doRefresh : function(){ var me = this, current = me.store.currentPage; if (me.fireEvent('beforechange', me, current) !== false) { me.store.loadPage(1, { callback: function (records, operation, success) { Ext.getCmp('educationGrid').getSelection(records, operation, success); } }); } } 

});

...................................

 getSelection: function(records, operation, success){ var grid= Ext.getCmp('educationGrid'); //my grid grid.getView().select(0); } 
+5
source

All Articles