PDA

View Full Version : Grid Paging Toolbar problem



vinodpadmanaban@gmail.com
16 Nov 2010, 5:59 AM
Hi,

I am getting paging issue when i delete the final record from last page, how can i resolve the paging issue, pls view the screen shot which i have attached.

http://www.freeimagehosting.net/uploads/7a38bace38.jpg

In Store save event(insert,update or delete) i will reload the store for update the grid for remote sort. like this


firstGridreader= new Ext.data.JsonReader({ root: 'res', id: 'HJid', idProperty: 'DefIndex', totalProperty: 'totalCount', successProperty: 'success', messageProperty: 'message', fields: fields }), var fGridStore = new Ext.data.Store({
proxy:ApGrpFGrdProxy,
autoLoad :false,
autoSave:false,
idProperty:'airBasicIndex',
baseParams:{start:0, limit:25},
reader:firstGridreader,
writer: fssuperGrdWriter,
listeners:{

save :function ( St, records, options ){
St.reload();
}
},
remoteSort:true
});
In Grid..
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: fGridStore,
displayInfo: true,
emptyMsg: "No records to display"
}),
if you view my screen shot.. 5 of 4 will be displayed .it happens when i delete the final record(or entire records) in last page after store reloads it show like 5 of 4 .
total page is updated as 4 since there is only 4 pages but its staying in the 5 page


how can i handle this problem or iam making any mistake or


how can i move to the previous page when i delete the final record in the last page.

Thanks in advance

lorezyra
17 Jan 2011, 10:15 PM
Try this thread solution...

http://www.sencha.com/forum/showthread.php?114168-Total-Row-Count-on-PagingToolbar-can-be-incorrect&highlight=PagingToolbar+total+update

Also, I would check the data for empty set and if true, move to the previous page...

Look at PagingToolbar.movePrevious (http://dev.sencha.com/deploy/dev/docs/source/PagingToolbar.html#method-Ext.PagingToolbar-movePrevious)()