Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 300
AMember Avatar asked Feb 06 '11 08:02

AMember


1 Answers

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
like image 129
Nitin Kamate Avatar answered Sep 28 '22 03:09

Nitin Kamate