|
|
@ -24,23 +24,15 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
this.$table = BI.Widget._renderEngine.createElement("<div>").css({ |
|
|
|
this.$table = BI.Widget._renderEngine.createElement("<div>").css({ |
|
|
|
position: "relative", |
|
|
|
position: "relative", |
|
|
|
display: "table", |
|
|
|
display: "table", |
|
|
|
width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch) ? "100%" : "auto", |
|
|
|
width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch || this._hasFill()) ? "100%" : "auto", |
|
|
|
height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto", |
|
|
|
height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto", |
|
|
|
"white-space": "nowrap" |
|
|
|
"white-space": "nowrap" |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.populate(this.options.items); |
|
|
|
this.populate(this.options.items); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_addElement: function (i, item) { |
|
|
|
_hasFill: function () { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
var td, width = ""; |
|
|
|
|
|
|
|
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; |
|
|
|
|
|
|
|
if (columnSize > 0) { |
|
|
|
|
|
|
|
width = columnSize < 1 ? |
|
|
|
|
|
|
|
((columnSize * 100).toFixed(1) + "%") |
|
|
|
|
|
|
|
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function hasFill() { |
|
|
|
|
|
|
|
if (o.columnSize.length > 0) { |
|
|
|
if (o.columnSize.length > 0) { |
|
|
|
return o.columnSize.indexOf("fill") >= 0; |
|
|
|
return o.columnSize.indexOf("fill") >= 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -49,8 +41,18 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_addElement: function (i, item) { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
var td, width = ""; |
|
|
|
|
|
|
|
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; |
|
|
|
|
|
|
|
if (columnSize > 0) { |
|
|
|
|
|
|
|
width = columnSize < 1 ? |
|
|
|
|
|
|
|
((columnSize * 100).toFixed(1) + "%") |
|
|
|
|
|
|
|
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); |
|
|
|
} |
|
|
|
} |
|
|
|
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) { |
|
|
|
if ((BI.isNull(columnSize) || columnSize === "") && this._hasFill()) { |
|
|
|
width = 2; |
|
|
|
width = 2; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|