fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

7 years ago
/**
* Created by User on 2017/3/22.
*/
Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-adapt"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_adapt",
items: [{
type: "bi.label",
7 years ago
text: "例子1:可用做水平居中",
7 years ago
cls: "layout-bg1",
width: 300,
height: 30
7 years ago
}]
7 years ago
});
7 years ago
},
_createAdaptLayout: function () {
return BI.createWidget({
type: "bi.horizontal_adapt",
7 years ago
columnSize: [300, "fill"],
7 years ago
items: [{
type: "bi.label",
text: "例子2:用于水平适应布局",
cls: "layout-bg1",
height: 30
7 years ago
}, {
type: "bi.label",
7 years ago
text: "水平自适应列",
7 years ago
cls: "layout-bg2",
height: 30
}]
7 years ago
});
7 years ago
},
7 years ago
7 years ago
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
7 years ago
}, {
column: 0,
row: 1,
el: this._createAdaptLayout()
7 years ago
}]
7 years ago
};
7 years ago
}
});
7 years ago
BI.shortcut("demo.horizontal_adapt", Demo.HorizontalAdapt);