Sencha - div不滚动

时间:2013-11-26 14:26:40

标签: html extjs scroll

我修改了像this这样的代码并添加了一些项目,因为我想用滚动来获取div,但它在Sencha中不起作用! 有什么建议? 提前谢谢!

代码:

/*global Ext:false */
Ext.application({
    launch: function () {
        Ext.create('Ext.Container', {
            fullscreen: true,
            styleHtmlContent: true,
            data: [{
                fname: 'Stratton',
                lname: 'Sclavos',
                role: 'Executive Chairman'
            }, 
etc. ], 
                tpl: '<div style="overflow: auto; overflow-y: auto;"><tpl for="."><div><strong>{lname}</strong>, {fname} <em class="muted">({role})</em></div></tpl></div>'
            }); // create()
        } // launch
    }); // application()

1 个答案:

答案 0 :(得分:3)

添加:

scrollable : {
    direction     : 'vertical'
},

像这样:

/*global Ext:false */
Ext.application({
    launch: function () {
        Ext.create('Ext.Container', {
            fullscreen: true,
            styleHtmlContent: true,
            scrollable : {
                direction     : 'vertical'
            },
            data: [{
                fname: 'Stratton',
                lname: 'Sclavos',
                role: 'Executive Chairman'
            }, 
etc. ], 
                tpl: '<div style="overflow: auto; overflow-y: auto;"><tpl for="."><div><strong>{lname}</strong>, {fname} <em class="muted">({role})</em></div></tpl></div>'
            }); // create()
        } // launch
    }); // application()