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.

40 lines
1.1 KiB

8 years ago
/**
* 默认的布局方式
*
* @class BI.DefaultLayout
* @extends BI.Layout
*/
BI.DefaultLayout = BI.inherit(BI.Layout, {
8 years ago
props: function () {
return BI.extend(BI.DefaultLayout.superclass.props.apply(this, arguments), {
8 years ago
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
items: []
});
},
8 years ago
render: function () {
BI.DefaultLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
8 years ago
},
_addElement: function (i, item) {
var w = BI.DefaultLayout.superclass._addElement.apply(this, arguments);
4 years ago
this._handleGap(w, item);
8 years ago
return w;
},
populate: function (items) {
BI.DefaultLayout.superclass.populate.apply(this, arguments);
8 years ago
this._mount();
8 years ago
}
});
BI.shortcut("bi.default", BI.DefaultLayout);