diff --git a/demo/js/widget/table/demo.responsive_table.js b/demo/js/widget/table/demo.responsive_table.js index 8009a5c9a5..c52f733532 100644 --- a/demo/js/widget/table/demo.responsive_table.js +++ b/demo/js/widget/table/demo.responsive_table.js @@ -129,23 +129,24 @@ Demo.Func = BI.inherit(BI.Widget, { isNeedMerge: true, isNeedFreeze: true, mergeCols: [0, 1], - columnSize: ["", "", ""], - items: items, - header: header + items: [], + header: [] }); BI.createWidget({ type: "bi.absolute", element: this, items: [{ el: { - type: "bi.grid", - columns: 2, - rows: 2, - items: [{ - column: 0, - row: 0, - el: table1 - }] + type: "bi.tab", + defaultShowIndex: 1, + cardCreator: function (v) { + switch (v) { + case 1: + table1.attr("columnSize", ["", "", ""]); + table1.populate(items, header); + return table1; + } + } }, left: 10, right: 10, diff --git a/dist/base.js b/dist/base.js index 0b650c665a..9a9a8b9eae 100644 --- a/dist/base.js +++ b/dist/base.js @@ -33415,12 +33415,20 @@ BI.Table = BI.inherit(BI.Widget, { }, + _empty: function () { + this.scrollBottomRight && this.scrollBottomRight.destroy(); + this.topLeft && this.topLeft.destroy(); + this.topRight && this.topRight.destroy(); + this.bottomLeft && this.bottomLeft.destroy(); + this.bottomRight && this.bottomRight.destroy(); + }, + populate: function (items, header) { this.options.items = items || []; if (header) { this.options.header = header; } - this.empty(); + this._empty(); if (this.options.isNeedFreeze) { this._createFreezeTable(); } else { diff --git a/dist/bundle.js b/dist/bundle.js index 04ac761150..8cb2ae8443 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -59288,12 +59288,20 @@ BI.Table = BI.inherit(BI.Widget, { }, + _empty: function () { + this.scrollBottomRight && this.scrollBottomRight.destroy(); + this.topLeft && this.topLeft.destroy(); + this.topRight && this.topRight.destroy(); + this.bottomLeft && this.bottomLeft.destroy(); + this.bottomRight && this.bottomRight.destroy(); + }, + populate: function (items, header) { this.options.items = items || []; if (header) { this.options.header = header; } - this.empty(); + this._empty(); if (this.options.isNeedFreeze) { this._createFreezeTable(); } else { diff --git a/dist/demo.js b/dist/demo.js index 21e78b236a..3adfe4f222 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -14112,23 +14112,24 @@ BI.shortcut("demo.preview_table", Demo.Func);Demo.Func = BI.inherit(BI.Widget, { isNeedMerge: true, isNeedFreeze: true, mergeCols: [0, 1], - columnSize: ["", "", ""], - items: items, - header: header + items: [], + header: [] }); BI.createWidget({ type: "bi.absolute", element: this, items: [{ el: { - type: "bi.grid", - columns: 2, - rows: 2, - items: [{ - column: 0, - row: 0, - el: table1 - }] + type: "bi.tab", + defaultShowIndex: 1, + cardCreator: function (v) { + switch (v) { + case 1: + table1.attr("columnSize", ["", "", ""]); + table1.populate(items, header); + return table1; + } + } }, left: 10, right: 10, diff --git a/src/base/table/table.js b/src/base/table/table.js index b516457a96..5c034a75cd 100644 --- a/src/base/table/table.js +++ b/src/base/table/table.js @@ -1580,12 +1580,20 @@ BI.Table = BI.inherit(BI.Widget, { }, + _empty: function () { + this.scrollBottomRight && this.scrollBottomRight.destroy(); + this.topLeft && this.topLeft.destroy(); + this.topRight && this.topRight.destroy(); + this.bottomLeft && this.bottomLeft.destroy(); + this.bottomRight && this.bottomRight.destroy(); + }, + populate: function (items, header) { this.options.items = items || []; if (header) { this.options.header = header; } - this.empty(); + this._empty(); if (this.options.isNeedFreeze) { this._createFreezeTable(); } else {