PDA

View Full Version : Using pull refresh in Sencha 2



sucheendarnath
9 Apr 2012, 5:11 PM
I want to know how to use pull refresh with list paging in the list with wcf service.
Supposing there are hundred results in the database.
The wcf service returns 10 records at a time per call.
The service will fetch first 10 records, next 10 and so on... depending on the params passed to it. I will pass the record-startnumber and record-endnumber as parameter so that it fetches the records between the same
How do i use pull refresh method to display first 10 records, and after being pulled it should display( first 10 and the next 10) and so on.
Please let me know on how to accompolish the same.
Please let me know whether the service should return all records.

mitchellsimoens
10 Apr 2012, 7:45 AM
As long as you send the total number then it will work quite well. You should only send a page at a tim so JSON response should be something like:


{
"total" : 500,
"items" : [
....
]
}

"total" is configurable with the totalProperty and "items" is configurable on the rootProperty both configs on the reader config.