From 6d3e08f12dbb6e57efef898e2a50a003afaedce2 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 30 Jul 2021 20:39:40 +0800 Subject: [PATCH 1/3] add --- src/core/wrapper/layout/adapt/adapt.table.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 1b7bebada..533568b62 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -40,7 +40,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { ((columnSize * 100).toFixed(1) + "%") : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); } - if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { + function hasFill() { + if (o.columnSize.length > 0) { + return o.columnSize.indexOf("fill") >= 0; + } + return BI.some(o.items, function (i, item) { + if (item.width === "fill") { + return true; + } + }); + } + if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) { width = 2; } if (!this.hasWidget(this._getChildName(i))) { From 31855236067cafd1945ec8ceb299eba681b0c3ab Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 30 Jul 2021 20:47:46 +0800 Subject: [PATCH 2/3] update --- src/core/wrapper/layout/layout.td.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index 93d38286c..aa64809b0 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -122,7 +122,7 @@ BI.TdLayout = BI.inherit(BI.Layout, { ((columnSize * 100).toFixed(1) + "%") : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); } - if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { + if ((BI.isNull(columnSize) || columnSize === "") && o.columnSize.indexOf("fill") >= 0) { width = 2; } var td = BI._lazyCreateWidget({ From b9af9d388375a2432db00df5b92a76113fc4fac6 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 30 Jul 2021 20:49:45 +0800 Subject: [PATCH 3/3] update --- src/core/wrapper/layout/layout.td.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index aa64809b0..4f1cf1d5c 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -122,7 +122,17 @@ BI.TdLayout = BI.inherit(BI.Layout, { ((columnSize * 100).toFixed(1) + "%") : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); } - if ((BI.isNull(columnSize) || columnSize === "") && o.columnSize.indexOf("fill") >= 0) { + function hasFill() { + if (o.columnSize.length > 0) { + return o.columnSize.indexOf("fill") >= 0; + } + return BI.some(arr, function (i, item) { + if (item.width === "fill") { + return true; + } + }); + } + if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) { width = 2; } var td = BI._lazyCreateWidget({