View Full Version : problem with refresh (reload) dynamic grid

19 Nov 2009, 4:11 PM
hi all, I've got a problem how can I reload a dynamic grid, because when I run for first time, all works, and it's ok, and so , this grid is in a panel with a button, so when I clicked the button appears a form with data from the grid and I change the data and close the form, the problem is when I close the form, the data in the grid no refresing,, I try with this,

callsStore.load({params: {start:'0',limit:10}});

but not works,
so can anybody help me please??

19 Nov 2009, 6:34 PM

What do you mean with: "but not works" ?? are you using firebug? what do you see? any request to the server? any js error? If you provide more information, it will be easier to help you.

May be I'm loosing something here... but did you try this?:


If you want to reload the store, just do it... :)

Best Regards

20 Nov 2009, 2:05 AM
What is callsStore??

I would do this;

callsGrid.getStore().getStore().baseParams = {start:'0',limit:10};

Not sure if you actually even need callsGrid.getView().refresh()

20 Nov 2009, 2:07 AM
callsGrid.getStore().removeAll(); // Not necessary
callsGrid.getStore().getStore().baseParams = {start:'0',limit:10};

Don't do


20 Nov 2009, 7:06 AM
:D, thank's to all, and specially to sancho, I put only the sentence


and works good :D, thank's men

20 Nov 2009, 9:31 AM
Are you interested in using the PagingToolbar, because that what it seems you are trying to accomplish.

var storeConfig= {
url: yourURL,
method: 'POST',
reader: new Ext.data.ArrayReader({
totalProperty: 'count',
root: 'rows',
idProperty: 'id',
fields: // Your field contract
autoDestroy: true,
remoteSort: true,
baseParams: {
// Anything that you require outside of start, limit, sort, dir because that will be fed by the PagingToolbar.

var yourStore = new Ext.data.Store(storeConfig);

new Ext.grid.GridPanel({
// ...
store: yourStore,
tbar: new Ext.PagingToolbar({
store: yourStore,
displayInfo: true,
pageSize: 10,
displayMsg: 'Records {0} - {1} of {2}',
emptyMsg: 'No records available'
// ...
listeners: {
resize: { // When the grid resizes, the pageSize will change. This will hit two to three times when the page resizes initially.
fn: function(scope, adjWidth, adjHeight, rawWidth, rawHeight) {
var toolbar = scope.getTopToolbar();
// Calculate paging size
var newPageSize = Math.floor(adjHeight / 25) - 1;
var activePage = Math.ceil((toolbar.cursor + 1) / newPageSize);
toolbar.pageSize = newPageSize;

Of course, your backend has to understand sort and dir as well to take advantage of the sort.