PDA

View Full Version : Is PullRefresh plugin not really usable?



abierbaum
16 Jan 2013, 6:45 AM
I have been tracking down a bug in our application and finally took a look at the code for PullRefresh and was a bit surprised at how it works.

Basically if I understand it correctly:

* When you refresh it sends off a request for the first page of data through the store proxy
* When it get's a response back it updates records in the store that are the same and any new data is inserted at the top in reverse order of how it was returned
* New items get rendered new, old items keep their current rendering

This fails for my for a couple of reasons:

1) The way the existing records get updated (record.set(newRecord.getData()) doesn't trigger the list to re-render the template for that item. ie. the user never sees any of the changes.

2) My proxy has server-side sorting and filtering so when the items are returned it doesn't reorder the existing ones and definitely doesn't add the new ones to the correct location in the list.

I really just need it to refresh the list so the store clears out and updates itself and am surprised it doesn't do this by default.

Am I using it wrong or is this the expected behavior?

liqingzhu
16 Jan 2013, 8:53 PM
I have a same problem as well

robowen
1 May 2013, 7:38 PM
Same problem for me.

Isnogud
3 May 2013, 12:49 AM
* When it get's a response back it updates records in the store that are the same and any new data is inserted at the top in reverse order of how it was returned
* New items get rendered new, old items keep their current rendering

This was exactly my problem. Found a temporary solution (until ST 2.3? ;)).

Extend the plugin or use this (https://github.com/p5hema2/Sencha-PullRefresh-RefreshFn).