PDA

View Full Version : TotalProperty not working on remote paging



v496820
1 Feb 2008, 6:01 AM
I am new to Ext, and I am trying to get a grid working with ColdFusion. I am doing paging remotely on the cfm page. The cfm takes the "start" and "limit" params from Ext and returns the only the required rows. That being said, it would return only 20 rows at a time and Ext assumes that these are all the records and the forward button on the bottom of the grid is disabled and the total is only 20! Can someone please tell me if what is the right approach. If I make the cfm return all 900 records, the grid shows all records at once. Thanks in advance.

halkon_polako
1 Feb 2008, 6:52 AM
You also must return the total number of rows (not the rows else the number of rows) as a property on your json response.

tunaboo
1 Feb 2008, 7:20 AM
Look up totalProperty for the store. If theres 900 elements need a totalProterty:900 somewhere..

devnull
1 Feb 2008, 9:32 AM
I think the vital concept being missed here is that you must query the database twice (if you are using a database).
Once without the start and limit params just to get a count of all rows for the totalProperty, and then again with the start and limit params to retrieve the actual page of records.

v496820
1 Feb 2008, 10:54 AM
I think the vital concept being missed here is that you must query the database twice (if you are using a database).
Once without the start and limit params just to get a count of all rows for the totalProperty, and then again with the start and limit params to retrieve the actual page of records.

Thanks, I did so. I passed the record count to the paging function as well and returned that to Ext. Thanks again!