首页 > 编程知识 正文

包含extjs滚动条位置的词条

时间:2023-12-24 12:11:51 阅读:321644 作者:WTBH

本文目录一览:

extjs 表格横向滚动偏移,有什么方法可以解决吗

根据现实情况panel 设置固定宽度,每列设置固定值,应该不会出现类似情况

EXTJS的combo组件的下拉选项框的高度和垂直滚动条如何设置

Ext.onReady(function() {

    var testStore = Ext.create('Ext.data.Store', {

            fields : ['code', 'name'],

            data : [{

            name : "先生",

            code : "01"

            }, {

            name : "女士",

            code : "02"

            }, {

            name : "先生",

            code : "03"

            }, {

            name : "女士",

            code : "04"

            }, {

            name : "先生",

            code : "05"

            }, {

            name : "女士",

            code : "06"

            }, {

            name : "先生",

            code : "07"

            }, {

            name : "女士",

            code : "08"

            }, {

            name : "先生",

            code : "09"

            }, {

            name : "女士",

            code : "10"

            }, {

            name : "先生",

            code : "05"

            }, {

            name : "女士",

            code : "06"

            }, {

            name : "先生",

            code : "07"

            }, {

            name : "女士",

            code : "08"

            }, {

            name : "先生",

            code : "09"

            }, {

            name : "女士",

            code : "10"

            }]

    });

    var testCombo = Ext.create('Ext.form.field.ComboBox', {

        displayField : 'name',

        valueField : 'code',

        editable : false,

        store : testStore,

        emptyText : 'hello',

        listConfig : {

            maxHeight : 100,

            getInnerTpl : function() {

                return 'div data-qtip="{code}"{name}/div';

            }

        }

    });

    

    Ext.create('Ext.container.Viewport', {

        layout : 'absolute',

        items : [testCombo]

    });

});

结果图:

combobox 本身的 maxHeight 不起作用,用 listConfig 中的 maxHeight 来设定

Extjs怎么在panel面板里面设置滚动条

设置scrollable:true.

如果内容超过panel的宽度、高度就会出现滚动条

scrollable : Boolean/String/Object

Configuration options to make this Component scrollable. Acceptable values are:

true to enable auto scrolling.

false (or null) to disable scrolling - this is the default.

x or horizontal to enable horizontal scrolling only

y or vertical to enable vertical scrolling only

Also accepts a configuration object for a Ext.scroll.Scroller if if advanced configuration is needed.

The getter for this config returns the Scroller instance. You can use the Scroller API to read or manipulate the scroll position:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。