2013-03-21 38 views
0

我已將兩個按鈕添加到我的容器中,現在點擊列表項不工作。請幫助。不能在sencha中輕按列表項

代碼

Ext.define('X.SelectCategories', { 
extend: 'Ext.Container', 
xtype: 'selectcategorypanel', 
id: 'SelectCategories', 
requires:[ 

], 

initialize:function(){ 
    this.callParent(); 

    jsonObject = Ext.create('Tablet').make_webservice_call('get_categories'); 

    Ext.getCmp('select_category_list').setData(jsonObject.info); 
    console.log(jsonObject.info); 
    //this.getNavigationBar.hide(); 

}, 



config: { 
    //title : 'Select Categories', 
    //iconCls: 'team', 
    //styleHtmlContent: true, 
    // scrollable: true, 
    layout: { 
     type: 'fit' 
    }, 
    items: [ 

     { 
      //fullscreen: true, 
      mode: 'MULTI', 
      /* 
      layout: { 
       type: 'fit' 
      }, 
      */ 
      //title:'Select Categories', 
      xtype: 'list', 
      itemTpl: '{name}', 
      autoLoad: true, 
      id:'select_category_list', 
      store: { 
       fields: ['name','title'] 

      } 

     }, 

     { 
      xtype: 'container', 
      //fullscreen: true, 
      layout: { 
       type: 'vbox' 
      }, 
      flex : 1, 
      layout: { 
       type : 'hbox', 
       align: 'bottom' 
      }, 
      defaults: { 
       xtype : 'button', 
       flex : 1, 
       margin: 10 
      }, 

      items: [ 
       {ui: 'round',ui:"confirm" ,text: 'Save',id: 'categorysaveButton'}, 
       {ui: 'round', ui:"decline" ,text: 'Reset',id: 'categoryresetButton'} 
      ] 

     } 

    ] 


} 

}) 
+0

我不知道,如果列表將正常工作,因爲我沒有看到任何商店的定義,如果你有商店爲什麼你叫'使用setData() '?此外'autoLoad'不是一個列表配置 – ThinkFloyd 2013-03-22 06:18:14

+0

我有商店。 Ext.create('Tablet')。make_webservice_call('get_categories')會以JSON的形式向服務器發送數據。該列表正確顯示。 – Harikrishnan 2013-03-22 06:22:14

回答

1

儘量延長Navigationview extend: 'Ext.navigation.View',