@@ -22,8 +22,6 @@ Ext4.define('LDK.panel.MultiRecordDetailsPanel', {
2222 } ) ;
2323
2424 this . callParent ( ) ;
25- this . showLoadMask ( ) ;
26-
2725 this . store = this . getStore ( ) ;
2826 this . mon ( this . store , 'load' , this . onStoreLoad , this ) ;
2927 this . mon ( this . store , 'exception' , function ( store , msg ) {
@@ -33,20 +31,27 @@ Ext4.define('LDK.panel.MultiRecordDetailsPanel', {
3331 alert ( msg ) ;
3432 } , this ) ;
3533
36- if ( ! this . store . getCount ( ) || this . store . isLoading )
34+ if ( ! this . store . getCount ( ) || this . store . isLoading ( ) )
3735 this . store . load ( ) ;
3836 else
3937 this . onStoreLoad ( ) ;
38+
39+ this . possiblyShowLoadMask ( ) ;
4040 } ,
4141
42- showLoadMask : function ( ) {
42+ possiblyShowLoadMask : function ( ) {
43+ //If the store has already loaded, dont show the mask
44+ if ( ! this . store . isLoading ( ) ) {
45+ return ;
46+ }
47+
4348 this . loadMask = this . loadMask || new Ext4 . LoadMask ( this , { msg : 'Loading...' } ) ;
4449
4550 if ( this . rendered ) {
4651 this . loadMask . show ( ) ;
4752 }
4853 else {
49- this . on ( 'afterrender' , this . showLoadMask , this , { single : true , delay : 100 } ) ;
54+ this . on ( 'afterrender' , this . possiblyShowLoadMask , this , { single : true , delay : 100 } ) ;
5055 }
5156 } ,
5257
@@ -61,7 +66,9 @@ Ext4.define('LDK.panel.MultiRecordDetailsPanel', {
6166
6267 onStoreLoad : function ( ) {
6368 this . removeAll ( ) ;
64- this . loadMask . hide ( ) ;
69+ if ( this . loadMask ) {
70+ this . loadMask . hide ( ) ;
71+ }
6572
6673 if ( ! this . store . getCount ( ) ) {
6774 this . add ( {
0 commit comments