PDA

View Full Version : PullRefresh not hiding Loader after finish



preyz
27 Apr 2011, 3:15 AM
I'm using the pullrefresh plugin with a custom function. Unfortunately I cannot get the loader to dissaper when finished. I'm probably somehow using or running the callback function wrong.

preyz
28 Apr 2011, 11:50 PM
Got it to work :-)



refreshFn: function(onLoadComplete, plugin){
Ext.Ajax.request({
url: '/tools/wait.php',
method: 'GET',
success: function(xhr, res) {
onLoadComplete.call(plugin);
},
});
},

volty41
16 Dec 2011, 7:29 AM
I have the same problem and i don't understand why and the code from preyz dosen't work for me.


plugins: [{
ptype: 'pullrefresh',
autoPaging: true,
refreshFn: function(plugin,list){
app.RestaurantStore.load();
}
}],

ahz.100
4 Feb 2012, 7:35 AM
I had the same issue. After some digging into sencha touch library (I am using Sencha Touch 1.1), I found a solution which is as follows:

1 - Find the onBounceEnd function in the sencha touch library



onBounceEnd:function(a,b){
if(b.axis==="y"){
if(this.isRefreshing){
this.isRefreshing=false;
this.setViewState("loading");
this.isLoading=true;
this.refreshFn.call(this,this.onLoadComplete,this);
}
}
},

2 - Change the last line this.refreshFn.call(this,this.onLoadComplete,this);
to this.refreshFn(this,this.onLoadComplete,this);

Thats it!
It worked perfectly for me after removing 'call'. This is somehow not being recognized. Just call the refreshFn directly.
Also note that you don't have to give arguments to the refreshFn. Just write your function and put its name like this:

refreshFn : myfunction

I hope it will help the above people and others. :)