PDA

View Full Version : PagingToolbar - refresh button help needed



baven
19 Jan 2011, 1:17 PM
I have a PagingStore defined like this:


var gridProxy = new Ext.data.HttpProxy( {
api : {
read : READ_URL
}
});

var gridReader = new Ext.data.JsonReader(
{
totalProperty : 'totalCount',
successProperty : 'success',
root : 'isList',
messageProperty : 'message'
},
[
'src',
...
....
]
);

var store = new Ext.ux.data.PagingStore( {
proxy : gridProxy,
reader : gridReader,
remoteSort : false,
autoSave : false,
baseParams : {},
batch : true
});

var grid = new Ext.grid.PricingGridPanel({
title:'Status',
store: store,
disableSelection:true,
// grid columns
columns:[
{
header: "<div style='text-align:center'>Source</div>",
dataIndex: 'src',
width: 250,
sortable: true
},{
header: "<div style='text-align:center'>Time</div>",
dataIndex: 'dt',
width: 200,
align: 'left',
renderer: renderTime,
sortable: true
},{
header: "<div style='text-align:center'>Status</div>",
dataIndex: 'status',
width: 420,
renderer: renderStatus,
sortable: false
}],

// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 50,
store: store,
displayInfo: true,
displayMsg: 'Displaying {0} - {1} of {2}',
emptyMsg: "No data to display"
})
});When I click the 'refresh' button on the PagingToolbar, it is NOT going to server and getting the new status list.

I also tried adding, but this did not help either.


Ext.override(Ext.PagingToolbar, {
refresh : function() {
delete this.store.lastParams;
this.doLoad(this.cursor);
}
});how do I get the status from the server for every 'refresh' click ??? I am using ExtJs 3.2.1