I need to write some action based on the refresh button in 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"
});
If you just want to do is once 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 pagebars.
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);
}
}
Note that if you doing so you have to double check it each time you update the EXTJS core to ensure functionality!