本文目录一览:
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: