PDA

View Full Version : PullRefreshPlugin Element disappears if List store is loaded while hidden



samsonasu
2 Aug 2011, 9:29 AM
There's a bug in PullRefreshPlugin where the loading indicator immediately scrolls off the page. This is caused by putting the list in a panel that is hidden (i.e. card layout) and loading it. It doesn't seem to happen all the time. For me in only happens on a list that is rendered into nested card panels.

Either way, there is an easy fix. The problem is that this.pullHeight gets set to 0. This override double checks for that condition when the list is updated and fixes it.



Ext.override(Ext.plugins.PullRefreshPlugin, {
onListUpdate: function() {
if (!this.rendered) {
this.render();
}

this.list.getTargetEl().insertFirst(this.el);
if (this.pullHeight === 0) {
this.pullHeight = this.el.getHeight();
}

if (!this.refreshFn) {
this.onLoadComplete.call(this);
}
}
});


Hope this helps somebody else out there.