PDA

View Full Version : Grid - Paging Toolbar does not reset



srarnold
21 Jun 2012, 3:36 AM
I have the following code which clears out my grid perfectly but the Paging Toolbar does not


store.removeAll();

store.totalLength = 0;

var grid = Ext.getCmp('grdFileList');

grid.refresh();

var pager = Ext.getCmp('pgFileList');
page.updateInfo(); // <--- This line resets the 'No Files to display', but leaves the Page x of x wrong and also the paging buttons


Is it possible to reset the Paging toolbar to disabled buttons and Page 0 of 0, I have looked everywhere and have not found an answer that works, I am currently using Ext JS 4.1

mrsunshine
21 Jun 2012, 5:10 AM
you can update the pagingtoolbar by the onLoad function

i tried it at a grid example: http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/paging.html

and do follwing in the browser console


Ext.ComponentQuery.query('grid')[0].getStore().removeAll();



Ext.ComponentQuery.query('pagingtoolbar')[0].onLoad()

bogc
5 Nov 2013, 6:44 PM
This doesn't work if the store uses remote paging, at least in 4.1. To make it work, I had to also set the totalCount member of the store to 0.


store.totalCount = 0;