PDA

View Full Version : grid paging problem



Ajish
19 Jun 2009, 1:36 AM
hii


my grid displaying all the contents even while paging is enabled


that is i am sending 30 rows of data to my page

i have placed paging bar on to the grid

with page size 25

so only 25 rows should show at a time

but in my case complete 30 rows are coming

and on the page bar it shows 'displaying 1-30 of 29'



one preview of my grid i have attacahed

14416

here is my code



var store = new Ext.data.JsonStore({
root: 'results',
totalProperty: 'total',
remoteSort: true,
url:'GridLoad.aspx',
fields: [
{name: 'id', type: 'int'},
{name:'WorkDetails',type:'string'},
{name:'Date',type:'string'},
{name:'TotalTime',type:'string'},
{name:'ProjectName',type:'string'}

],
sortInfo:{field: 'id', direction: "ASC"}
});

// load data from the url ( data.php )
var pagingBar = new Ext.PagingToolbar({
pageSize: 25,
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"


});


store.load({params:{start:0, limit:25}});

respose data from firebug

[code]
({"total":29,"results":[{"UserId":"3","WorkDetails":" hdgcjfh","Date":"06/09/2009 00:00:00","TotalTime"
:"12","ProjectName":"55 CLUB windows"},{"UserId":"3","WorkDetails":" tretrtert","Date":"06/02/2009
00:00:00","TotalTime":"rtr","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"tyituyi","Date"
:"06/12/2009 00:00:00","TotalTime":"11","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp
;yh","Date":"01/01/1900 00:00:00","TotalTime":"12","ProjectName":"55 club web"},{"UserId":"3","WorkDetails"
:" gfhfgh","Date":"06/12/2009 00:00:00","TotalTime":"12","ProjectName":"55 club web"},{"UserId"
:"3","WorkDetails":" gfhfgh","Date":"06/12/2009 00:00:00","TotalTime":"12","ProjectName":"55 club
web"},{"UserId":"3","WorkDetails":"ewrfre","Date":"06/12/2009 00:00:00","TotalTime":"12","ProjectName"
:"55 club web"},{"UserId":"3","WorkDetails":" fdsgfdsgfdsgfdsgsdfgfbvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"
,"Date":"06/12/2009 00:00:00","TotalTime":"11","ProjectName":"55 club web"},{"UserId":"3","WorkDetails"
:" hgjhjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj","Date"
:"06/12/2009 00:00:00","TotalTime":"12","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp
;fdggdfgdfgdfsgfg","Date":"06/12/2009 00:00:00","TotalTime":"1212","ProjectName":"55 club web"},{"UserId"
:"3","WorkDetails":"fdgdfgdfg","Date":"06/03/2009 00:00:00","TotalTime":"11","ProjectName":"55 CLUB windows"
},{"UserId":"3","WorkDetails":"&nbsp;dsfsdfsdfdsfsdf<BR><BR>sdfdsfsdfsdfsd<BR><BR>sdfsdfsd","Date":"06
/03/2009 00:00:00","TotalTime":"11","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;gkhjkjhk"
,"Date":"01/01/1900 00:00:00","TotalTime":"","ProjectName":"55 CLUB windows"},{"UserId":"3","WorkDetails"
:"&nbsp;gkhjkjhk","Date":"06/09/2009 00:00:00","TotalTime":"75755","ProjectName":"55 CLUB windows"},
{"UserId":"3","WorkDetails":"&nbsp;kl;l;lk;kl;kl;<BR><BR>kl;kl;kl;kl<BR><BR>;lk;ik;","Date":"06/09/2009
00:00:00","TotalTime":"11","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;tgjh","Date"
:"06/02/2009 00:00:00","TotalTime":"33","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp
;kll;jkl;","Date":"06/02/2009 00:00:00","TotalTime":"77","ProjectName":"55 club web"},{"UserId":"3","WorkDetails"
:"&nbsp;1.assadadada<BR><BR>2.sdsafddsfds","Date":"01/01/1900 00:00:00","TotalTime":"11","ProjectName"
:"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;tdryrtytrey","Date":"01/01/1900 00:00:00","TotalTime"
:"12","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;tdryrtytrey","Date":"01/01/1900
00:00:00","TotalTime":"12","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;ghfghfg"
,"Date":"01/01/1900 00:00:00","TotalTime":"11","ProjectName":"55 club web"},{"UserId":"3","WorkDetails"
:"&nbsp;tyettreyrt","Date":"01/01/1900 00:00:00","TotalTime":"66","ProjectName":"55 club web"},{"UserId"
:"3","WorkDetails":"&nbsp;nmvbvb","Date":"01/01/1900 00:00:00","TotalTime":"11","ProjectName":"55 club
web"},{"UserId":"3","WorkDetails":"&nbsp;nmvbvb","Date":"01/01/1900 00:00:00","TotalTime":"11","ProjectName"
:"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;uyoiyuoi","Date":"01/01/1900 00:00:00","TotalTime"
:"55","ProjectName":"55 CLUB windows"},{"UserId":"3","WorkDetails":"&nbsp;pppklj'kl'j","Date":"01/01
/1900 00:00:00","TotalTime":"99","ProjectName":"55 club web"},{"UserId":"3","WorkDetails":"&nbsp;;'l'lk'l
;'","Date":"06/01/2009 00:00:00","TotalTime":"8","ProjectName":"55 club web"},{"UserId":"3","WorkDetails"
:"&nbsp;trjuy","Date":"01/01/1900 00:00:00","TotalTime":"66","ProjectName":"55 CLUB windows"},{"UserId"
:"3","WorkDetails":"&nbsp;uyouyoyu","Date":"01/01/1900 00:00:00","TotalTime":"8","ProjectName":"55 club
web"},{"UserId":"3","WorkDetails":"&nbsp;hjkljhkjhgk","Date":"16/06/2009 00:00:00","TotalTime":"4","ProjectName"
:"55 club web"}]})

evant
19 Jun 2009, 1:39 AM
Because you're returning more than 25 records. It's up to you to figure out which records you need to return on the server side. What's the point in doing paging otherwise?

Ajish
19 Jun 2009, 1:45 AM
so each time it will go to the server

while clicking paging

currently i am returning whole data from db

and giving to the page

evant
19 Jun 2009, 1:49 AM
As I said, you have to return the appropriate number of results from the server. If it asks for 25, you need to give it 25.