2013-03-27 71 views
-1

我需要在sencha touch中創建一個像這樣的視圖。我是初學者。請幫幫我。我沒有在組件上獲得點擊事件。如何在sencha touch 2中創建這樣的視圖?

enter image description here

我的代碼

config: { 
    defaults: { 
     margin: 10 
    }, layout: { 
     type: 'hbox' 
    }, 
    items: [{ 

     flex:1, 
     layout: { 
      type: 'vbox' 
     }, 
     items: [ 
      { 
       xtype: 'component', flex: 10, 
       html: 'Flex: 1', style: 'background-color: lightgray' 
      }, 
      { 
       xtype: 'spacer',flex:1 
      }, 
      { 
       xtype: 'component', flex: 10, 
       html: 'Flex: 2', style: 'background-color: pink' 
      } 
     ] 
    }, { 

     flex: 1, 
     layout: { 
      type: 'vbox' 
     }, 
     items: [ 
      { 
       xtype: 'component', flex: 10, 
       html: 'Flex: 3', style: 'background-color: orange', 
       handler:function() { 
        console.log('Tapped !'); 
       } 


      }, 
      { 
       xtype: 'spacer',flex:1 
      }, 
      { 
       xtype: 'component', flex: 10, 
       html: 'Flex: 4', style: 'background-color: lightblue' 
      } 
     ] 


    }] 
+0

請發佈您嘗試過的代碼。 – Eli 2013-03-27 05:26:18

+0

@Harikishnan我放棄了你的問題,因爲你沒有展示你嘗試過什麼,只是要求人們爲你做工。但不要連續低估其他用戶作爲報復,因爲您的帳戶可能因爲投票違規而被暫停。 – Eli 2013-03-27 05:52:17

+0

你點擊事件不工作的原因是沒有Ext.Component的處理程序配置。只有Ext.Button的處理程序配置 – 2013-03-27 08:01:18

回答

0

嘗試Ext.dataview.DataView。你會從github獲得例子。