【问题标题】:Sencha Touch 1.1.: Cannot scroll and select rows in Ext.List, which is nested inside Ext.CarouselSencha Touch 1.1.: Ext.List 中无法滚动和选择行,嵌套在 Ext.Carousel 中
【发布时间】:2012-02-20 07:39:11
【问题描述】:

使用 Sencha Touch 1.1 版,我尝试在 Ext.Carousel 中放置几个​​ Ext.List 类型的列表,以便: 1.我可以水平滑动以在几个不同的列表之间切换。 2.同时我希望能够滚动可见列表并能够选择一行等。

目前有效: 我可以将几个列表添加到轮播中。一切都完美呈现。水平滑动手势有效,因此我可以在不同列表之间切换。

问题: 我无法滚动并从列表中选择一行。 轮播似乎消除了所有事件,而我的列表对任何拖动、滚动或单击事件都没有反应。

有什么想法吗?

 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();

【问题讨论】:

  • 我刚刚将您的代码复制并粘贴到我的项目中,它工作正常。

标签: sencha-touch extjs


【解决方案1】:

如果你只是没有解决问题,

尝试使用“scrollable: true”而不是“scroll”

或尝试在轮播中使用可滚动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 1970-01-01
    • 2012-10-06
    • 1970-01-01
    • 2012-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多