Only show Paging Toolbar when appropriate

One of Sencha User, Joel, pointed out one of problems in Sencha Touch ListPagingPlugin that display ‘Load more…’ message even if a result gave less rows than paging size.

Below code he suggested will fix the problem:

Ext.override(Ext.plugins.ListPagingPlugin, {
onListUpdate : function() {
if (this.list.store && this.list.store.data.length < (this.list.store.currentPage * this.list.store.pageSize)) {
if (!this.rendered) {
return false;
} else if (!this.autoPaging) {
this.el.removeCls('x-loading');
this.el.remove();
} else {
this.loading = false;
}
return false;
}

if (!this.rendered) {
this.render();
}

this.el.appendTo(this.list.getTargetEl());
if (!this.autoPaging) {
this.el.removeCls('x-loading');
}
this.loading = false;
}
});