2012-02-20 25 views
2

Sencha Touch 1.1版中,我嘗試在Ext.Carousel中放入幾個Ext.List類型的列表,以便: 1.我可以水平滑動以便在幾個不同的列表之間切換。 2.與此同時,我希望能夠滾動瀏覽可見列表並能夠選擇一行等。Sencha Touch 1.1 .:無法滾動和選擇Ext.List中的行,它嵌套在Ext.Carousel內

目前爲止: 我可以將多個列表添加到輪播。一切都完美呈現。水平滑動手勢的作品,以便我可以在不同的列表之間切換。

問題: 我無法滾動並從列表中選擇一行。 旋轉木馬似乎消除了所有事件,並且我的列表不會對任何拖動,滾動或單擊事件做出反應。

有什麼想法?

Ext.regModel('Contact', { 
fields: ['firstName', 'lastName']}); 

var store = new Ext.data.JsonStore({ 
    model : 'Contact', 
    sorters: 'lastName', 

    getGroupString : function(record) { 
     return record.get('lastName')[0]; 
    }, 

    data: [ 
     {firstName: 'Tommy', lastName: 'Maintz'}, 
     {firstName: 'Rob',  lastName: 'Dougan'}, 
     {firstName: 'Ed',  lastName: 'Spencer'}, 
     {firstName: 'Jamie', lastName: 'Avins'} 
    ] 
}); 

var list1 = new Ext.List({ 
    fullscreen:true, 
    itemTpl : '{firstName} {lastName}', 
    grouped : true, 
    indexBar: false, 
    scroll: true, 
    store: store 
}); 


var list2 = new Ext.List({ 
    fullscreen:true, 
    itemTpl : '{firstName} {lastName}', 
    grouped : true, 
    indexBar: false, 
    scroll: true, 
    store: store, 
    listeners : { 
       itemtap : function(view, index, item, e) { 
        alert("test for tab works"); 
       } 
      } 
}); 

    carousel = new Ext.Carousel({ 
     indicator:false, 
     direction:'horizontal', 
     fullscreen:true, 
     items: [ 
      list1, 
      list2 
] 
}); 

carousel.show(); 
list1.show(); 
list2.show(); 
+0

我剛剛複製並將您的代碼粘貼到我的項目中,它工作正常。 – 2012-02-20 18:25:33

回答

0

如果你只是沒有解決問題,

嘗試使用「滾動:真」,而不是「滾動」

或嘗試使用滾動傳送帶內。