Sencha触摸滚动不起作用

时间:2015-11-25 13:16:35

标签: javascript extjs scroll sencha-touch sencha-touch-2

我有一个main.js

**Ext.define('EDevlet.view.Main', {
viewport: {
    autoMaximize: true
},
extend: 'Ext.Container',
xtype: 'mainview',
defaultColumnCount: 2,
config: {
    scrollable:"vertical",
    cls: "page-content-style page-with-main-buttons",
    fullscreen: true,
    title: i18n["edevlet_title"],
    flex:1,
    height:800,
    layout: {
        type: 'vbox',
        align: 'stretch'

    },
    defaults: {
        flex:1
    },
    items: [{
        xtype: "panel",
       id: "greeting-message",
        cls: "greeting",
        docked: "top"
    }
    ]
},**


loadMenu: function () {   
    Logger.log("@Main::loadMenu");
    this.removeAll(true, false);
    var services = SegmentUtil.getServiceContent(), // boş olma ihtimali yok, BE den gelmez ise yereldeki DEFAULT segment içeriğini kullanıyor
        maxServiceSize = SegmentUtil.getHomePageMaxServiceSize(),
        columnCount = this.defaultColumnCount,
        rowCount = Math.ceil((maxServiceSize + 1) / columnCount), // +1 diğer servisler düğmesi için !
        index,
        service,
        title,
        itemId,
        button,
        menuRow,
        rowIndex,
        isLeftSide,
        verticalPosition = -1;

    Logger.log('services: ' + services);
    Logger.log('rowCount: ' + rowCount + ', columnCount: ' + columnCount + ', maxServiceSize: ' + maxServiceSize);

    // satırları oluştur
    var newCount=rowCount+1;
    for (index = 0; index < newCount; index++) {
        if(index==0){

               **this.add({
                   id: 'mainRow-' + index,
                   xtype: 'carousel',   flex:3,
                   layout: 'hbox',
                  defaults: {
                       flex:1
                   },       items: [
                                    {    id: 'Image1',
                                         html: ''
                                    },
                                    {  id: 'Image2',

                                        html: ''
                                    },
                                    {    id: 'Image3',
                                        html: ''

                                   },
                                    {   id: 'Image4',
                                       html: ''
                                    }
                                ]
        });
                this.requestBackEndForNewsUrl();
        }
        else{

        this.add({
            id: 'mainMenuRow-' + index,
            xtype: 'container',
            flex:2,
          layout: 'hbox',
            defaults: {
                flex:1
            }
        });
        }**
    }




        }



    }

我有一个加载功能。加载功能添加项目(此项目是图像)。但我的scrool似乎但不工作。我按住滚动但是如果发布滚动正在上升。 我有一个vbox.After两个hbox后添加。但滚动不起作用。

2 个答案:

答案 0 :(得分:1)

试试这个。在app.js文件中写下此覆盖代码&amp;然后检查。

// Fix for scroll 
Ext.override(Ext.util.SizeMonitor, {
constructor: function (config) {
    var namespace = Ext.util.sizemonitor;
    return new namespace.Scroll(config);
}
});
Ext.override(Ext.util.PaintMonitor, {
constructor: function (config) {
    return new Ext.util.paintmonitor.CssAnimation(config);
}
});

答案 1 :(得分:0)

将您的视图配置更改为:

scrollable: {
            direction: 'vertical',
            directionLock: true
},
flex:1,
height: '100%',

这将符合您的目的。如果有帮助,请告诉我。