Ext js Updating the total count of a paging toolbar on the fly

AMember picture AMember · Feb 6, 2011 · Viewed 23.7k times · Source

This should be fairly simple but I haven't found a way to do it yet.

I am using a ExtJs v.3.3.

I have a grid panel that allows record deletion with context menu.

The grid has a paging toolbar that is attached to the panel store.

The deletion process sends an ajax request to the server, on success I remove the record from the store (using the remove method).

The thing is that the paging toolbar does not reflect the change in the store , that is the total amount of records is unchanged until the store is reloaded.

Is there any way to set the total amount of records in the paging toolbar?

Thanks

Answer

Nitin Kamate picture Nitin Kamate · Jun 29, 2013

This works like a charm for ExtJs ver 4.1.3.

gridStore.add(record);                    //Add the record to the store    
gridStore.totalCount = gridStore.count(); //update the totalCount property of Store
pagingToolbar.onLoad();                   //Refresh the display message on paging tool bar