包含extjs滾動條位置的詞條

本文目錄一覽:

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:

原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/247757.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
小藍的頭像小藍
上一篇 2024-12-12 13:22
下一篇 2024-12-12 13:22

相關推薦

發表回復

登錄後才能評論