PDA

View Full Version : PagingToolbar & HttpProxy



Grimsk
13 Sep 2007, 7:18 AM
I try to use for the first time Ext.grid *..

I have build a grid who load data with HttpProxy..
..so far so good..

then i have added a PagingToolbar (:| *problems come here*

in my store i receive 20 rows..

but i want to display only 5 of them...
so i set the pageSize to 5 ...

but the page display the 20 rows anyway...

so .. do i need to rebuild the backend script to send only 5 row at time?
or i missed something?

BernardChhun
13 Sep 2007, 7:27 AM
Can you show us some code? my guess for now would be that your server side doesn't catch the limit value correctly but I'm often wrong in my guesses... :)

Animal
13 Sep 2007, 7:29 AM
The server should only send what you ask for in pageSize. That's up to you.

Grimsk
13 Sep 2007, 7:30 AM
Hi mr. Chunn :D i always love when you teach me ! lol

your server side doesn't catch the limit value correctly

my server side send all data! .. i need to send only requested row?

Grimsk
13 Sep 2007, 7:34 AM
so i will redo my backend query

from firebug:


dir ASC
limit 2
sort name
start 2


!! i got all sql params already :D

BernardChhun
13 Sep 2007, 7:36 AM
yup that is what Server Side Paging is all about.



dir ""
limit 5
sort ""
start 0

these are the params that the paging toolbar usually send.

in mySQL I'd build this SELECT statement:



SELECT * FROM anyTable WHERE whateverCondition ORDER BY sort dir LIMIT start, limit

so if you have 20 rows for whateverCondition, your server side will only send 5 rows to ExtJs. don't forget to send the total row value in your JSON though so that the paging works correctly

Grimsk
13 Sep 2007, 7:41 AM
PagingToolbar & HttpProxy = 1
bugs = 0

thnks guys :D

Cester
13 Sep 2007, 8:43 AM
Im using MS access as the database, and there are no support for LIMIT in the SQL language/statement.

I have the same error with an other project of mine. Here is it a MSSQL server that haves the same issue as MS acesse

Can anyone tell me how to limit my data?

BernardChhun
13 Sep 2007, 8:59 AM
wasn't it
SELECT TOP 10?