PDA

View Full Version : PullRefresh & ListPaging throw errors if list has no loading text..



djkraz
29 Mar 2011, 6:54 AM
In both of these the actions will error in the following block of code if loadingText is set to null or an empty string:

onBeforeLoad: function() {
if (this.isLoading && this.list.store.getCount() > 0) {
this.list.loadMask.disable();
return false;
}
},

The fix is to add a check to make sure a load mask is defined before attempting to disable it...


onBeforeLoad: function() {
if (this.isLoading && this.list.loadMask && this.list.store.getCount() > 0) {
this.list.loadMask.disable();
return false;
}
},

gkatz
12 Apr 2011, 4:47 AM
this actually happens even if there is a loading text.
I am sorry to not be able to post my app code (its a large app and sometimes it works and sometimes not - could not produce a test that will fail all the time) but the error is:

TypeError: Result of expression 'this.list.loadMask' [null] is not an object.
and my fix was similar:


Ext.plugins.ListPagingPlugin = Ext.extend(Ext.util.Observable, {...
onBeforeLoad : function() {
if (this.loading && this.list.store.getCount() > 0) {
if(this.list.loadMask!=null){
this.list.loadMask.disable();
return false;
}
}
},