PDA

View Full Version : Pagging toolbar refresh button blank result



stoneboys
7 Dec 2011, 7:05 AM
Hi all,help me please..

I have code for GRID,
This PROXY:
var ADProxy = Ext.create('Ext.data.AjaxProxy',{
api: {
create : 'grid.php',
read : 'grid.php',
update : 'grid.php',
destroy : 'grid.php'
},
actionMethods: {
create : 'POST',
read : 'GET',
update : 'POST',
destroy: 'GET'
},
reader: {
root: 'results',
totalProperty : 'total'
}

});

AND for Store :
var Ad_store = Ext.create('Ext.data.Store', {
autoDestroy: true,
autoLoad: false,
model: 'MainR',
storeId: 'Main',
proxy: ADProxy,
sorters: [{
property: 'MainReferenceId',
direction: 'ASC'
}]
});

AND GRID :
var Ad_grids = Ext.create('Ext.grid.Panel', {
id : 'Ad_grid',
store : Ad_store,
trackOver : false
stripeRows : true,
border : false,
columns : Ad_columns,
frame : false,
selType : 'rowmodel',
afterRender : function() {
Ad_grids.superclass.afterRender.call(this);
Ad_store.load({params:{task:'view'}});
}
});


Now, on my panel to show grid i have Pagging toolbar on bottom:

bbar: Ext.create('Ext.PagingToolbar', {
store: Ad_store,
displayInfo: true,
displayMsg: 'Displaying items {0} - {1} of {2}',
emptyMsg: "No items to display"
})

On first show, my grid is ok, But If I push refresh button on pagging toolbar my grid is blank, because I use afterRender with params to show data from database..

What wrong here, how to make refresh button show data for My Grid with params? or another way maybe?
Thanks!

mitchellsimoens
9 Dec 2011, 11:46 AM
If you need to have params persist then add them to the extraParams object on the proxy.