【问题标题】:Sencha Touch not firing beforeshow event listenerSencha Touch 未触发 beforeshow 事件监听器
【发布时间】:2011-11-11 13:09:48
【问题描述】:

我是煎茶触摸的新手,并且正在经历强制性的头发拉扯和 head2desk 冲击。

我正在尝试显示一个列表,但我遇到了问题。

我使用 beforeshow 事件在列表显示之前加载我的 json 存储。但它不会触发事件。如果有任何可以提供帮助的,我们将不胜感激。

我的代码如下:*注意- 此代码以 AS/400 为中心,因此 /%...%/ 是为此而设计的

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%/'                        
                       }                                           
                 });                                               
               }                                                   
             }                                                     
         });                

}

【问题讨论】:

    标签: json extjs


    【解决方案1】:

    beforeshow 监听器仅在您使用 show() 方法显示项目时触发。

    尝试使用监听器 'render'、'beforeerender' 和 'afterrender'。 改为。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多