user931012
user931012

Reputation:

Sencha Touch not firing beforeshow event listener

Im new to sencha touch and going through the obligatory hair pulling and head2desk pounding.

Im trying to display a List but Im having a problem.

Im using a beforeshow event to load my json store before the list is displayed. But it's not firing the event. If any can help it is MOST appreciated.

My code is as follows: *note- this code is AS/400 centric so the /%...%/ is for that

function doList() {                                             
        var List1 = new Ext.List  ({                            
            id : List1,                                         
            renderTo : 'panel',                                 
            fullscreen: true,                                   
            showAnimation: {                                    
                   type: 'slide',                               
                   duration: 250                                
                    },                                          
              cls: 'demo-list',                                 
              width: Ext.is.Phone ? undefined : 300,            
              height: 500,                                      
              store: ListStore,                                 
              itemTpl: '<strong>{SCEQPT}</strong>',             
              grouped: true,                                    
              indexBar: true,                                   
              onItemDisclosure: function(record, btn, index) {  
                   doPopUp(record);                                
                   },                                              
             listeners: {                                          
                      'beforeshow': function () {                  
                       alert('beforeshow');                        
                       var StoreList = Ext.StoreMgr.get('ListStore'
             StoreList.load({                                      
                       params: {                                   
                       screfr: Ext.getCmp('SCREFR').getValue(),    
                       scptyp: scptyp,                             
                       user  : '/%SCUSER%/'                        
                       }                                           
                 });                                               
               }                                                   
             }                                                     
         });                

}

Upvotes: 0

Views: 2195

Answers (1)

heyjii
heyjii

Reputation: 834

beforeshow listener is triggered only when you are displaying an item with show() method.

Try using the listeners 'render','beforerender' and 'afterrender'. instead.

Upvotes: 2

Related Questions