PDA

View Full Version : help with paging in dynamic grid



andryi
19 Nov 2009, 2:41 PM
hi all, I've got a problem with paging toolbar in my grid, when I run in the first time, I've got the pagination like a "01 - 010" instead of "1 - 10" and if I put next I've "101" instead of "2"
can anybody help me

here a cap, to explain better

andryi
20 Nov 2009, 7:23 AM
no answers??

carol.ext
20 Nov 2009, 7:46 AM
No code? (use [code/] tags)

andryi
20 Nov 2009, 7:59 AM
well this a pagingtoolbar:


var paging = new Ext.PagingToolbar({
pageSize: PageSize,
store: callsStore,
displayInfo: true,
refreshText:'',
displayMsg: '{0} - {1} of {2}',
emptyMsg: ''
});


and
this is my grid



callsGrid = new Ext.grid.GridPanel({
id: 'callsGrid',
// el: 'callsGrid',
height: 400,
width: 820,
//autoWidth:true,
frame: true,
border: true,
title: 'Bulletins',
store: callsStore,
colModel: colModel,
bbar: paging
})


here is the store load



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


and well if and put next and later I put back, the paging is normal from "1-10 of 16"(displaying info) and in the text is "Page 1 of 2", and If I put again next appears "Page 2 of 2", so my problem is when for first time create the grid the paging is wrong, only when load the grid for first time

Mike Robinson
20 Nov 2009, 8:14 AM
Be certain (a) that you do specify the page-size, and (b) that your initial "Load" request specifies a chunk of records corresponding to one page.

Subsequently, pay attention to "reload()" vs. "load()" so that you do not lose the start/limit settings and accidentally wind up requesting the world. I put them in "baseParams."

Be sure that you do tests with large datasets just to be sure that nothing like this has slipped through.

CrazyEnigma
20 Nov 2009, 9:43 AM
What does your store config look like?

I agree with mike, you might want to specify your pageSize (very important).

I am not sure if autoDestroy needs to be set to true.

Your Server Response might be causing the problem.
you need to return and specify them in the Reader a total count, root, and idProperty.

I didn't do this, and my display went wonky.

carol.ext
20 Nov 2009, 10:00 AM
Did you try making start/limit numbers instead of strings?

andryi
20 Nov 2009, 11:46 AM
yeah, carol that was the error, I shoulded put number no string or characters, sorry for my delayed answer:P