guy 7 years ago
parent
commit
a49a249ffb
  1. 52
      bi/base.js
  2. 52
      docs/base.js
  3. 5
      src/base/collection/collection.js
  4. 9
      src/base/grid/grid.js
  5. 17
      src/base/table/table.collection.js
  6. 15
      src/base/table/table.grid.js
  7. 6
      src/base/table/table.resizable.js

52
bi/base.js

@ -2845,6 +2845,11 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return this._getMaxScrollTop(); return this._getMaxScrollTop();
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();
@ -14759,6 +14764,7 @@ BI.GridView = BI.inherit(BI.Widget, {
var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -14809,7 +14815,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[rowIndex] = child; renderedWidgets[count++] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -14942,6 +14948,11 @@ BI.GridView = BI.inherit(BI.Widget, {
this.options.estimatedRowSize = height; this.options.estimatedRowSize = height;
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();
@ -14955,7 +14966,6 @@ BI.GridView = BI.inherit(BI.Widget, {
populate: function (items) { populate: function (items) {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
this.restore();
} }
this._populate(); this._populate();
} }
@ -28711,7 +28721,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () { _populateScrollbar: function () {
var o = this.options; var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -28752,7 +28763,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateTable: function () { _populateTable: function () {
var self = this, o = this.options; var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -28783,7 +28795,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -28963,8 +28975,10 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
return; return;
} }
if (this._isNeedDigest === true) { if (this._isNeedDigest === true) {
this._reRange();
this._digest(); this._digest();
} }
this._isNeedDigest = false;
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -29059,6 +29073,13 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
this.bottomRightCollection.restore(); this.bottomRightCollection.restore();
}, },
_reRange: function () {
this.topLeftCollection.reRange();
this.topRightCollection.reRange();
this.bottomLeftCollection.reRange();
this.bottomRightCollection.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }
@ -29671,6 +29692,10 @@ BI.GridTable = BI.inherit(BI.Widget, {
if (this._width <= 0 || this._height <= 0) { if (this._width <= 0 || this._height <= 0) {
return; return;
} }
if (this._isNeedDigest === true) {
this._reRange();
this._isNeedDigest = false;
}
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -29728,10 +29753,12 @@ BI.GridTable = BI.inherit(BI.Widget, {
setColumnSize: function (columnSize) { setColumnSize: function (columnSize) {
this.options.columnSize = columnSize; this.options.columnSize = columnSize;
this._isNeedDigest = true;
}, },
setRegionColumnSize: function (regionColumnSize) { setRegionColumnSize: function (regionColumnSize) {
this.options.regionColumnSize = regionColumnSize; this.options.regionColumnSize = regionColumnSize;
this._isNeedDigest = true;
}, },
getColumnSize: function () { getColumnSize: function () {
@ -29744,11 +29771,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { if (items && this.options.items !== items) {
this._isNeedDigest = true;
this.options.items = items; this.options.items = items;
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && this.options.header !== header) {
this._isNeedDigest = true;
this.options.header = header; this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
@ -29763,6 +29792,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.restore(); this.bottomRightGrid.restore();
}, },
_reRange: function () {
this.topLeftGrid.reRange();
this.topRightGrid.reRange();
this.bottomLeftGrid.reRange();
this.bottomRightGrid.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }
@ -32356,8 +32392,10 @@ BI.ResizableTable = BI.inherit(BI.Widget, {
}; };
var stop = function (j, size) { var stop = function (j, size) {
self.resizer.setVisible(false); self.resizer.setVisible(false);
o.columnSize[j] = size; var columnSize = o.columnSize.slice();
self.table.setColumnSize(o.columnSize); columnSize[j] = size;
o.columnSize = columnSize;
self.table.setColumnSize(columnSize);
self.table.populate(); self.table.populate();
self._populate(); self._populate();
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE);

52
docs/base.js

@ -2845,6 +2845,11 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return this._getMaxScrollTop(); return this._getMaxScrollTop();
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();
@ -14759,6 +14764,7 @@ BI.GridView = BI.inherit(BI.Widget, {
var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -14809,7 +14815,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[rowIndex] = child; renderedWidgets[count++] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -14942,6 +14948,11 @@ BI.GridView = BI.inherit(BI.Widget, {
this.options.estimatedRowSize = height; this.options.estimatedRowSize = height;
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();
@ -14955,7 +14966,6 @@ BI.GridView = BI.inherit(BI.Widget, {
populate: function (items) { populate: function (items) {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
this.restore();
} }
this._populate(); this._populate();
} }
@ -28711,7 +28721,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () { _populateScrollbar: function () {
var o = this.options; var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -28752,7 +28763,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateTable: function () { _populateTable: function () {
var self = this, o = this.options; var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -28783,7 +28795,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -28963,8 +28975,10 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
return; return;
} }
if (this._isNeedDigest === true) { if (this._isNeedDigest === true) {
this._reRange();
this._digest(); this._digest();
} }
this._isNeedDigest = false;
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -29059,6 +29073,13 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
this.bottomRightCollection.restore(); this.bottomRightCollection.restore();
}, },
_reRange: function () {
this.topLeftCollection.reRange();
this.topRightCollection.reRange();
this.bottomLeftCollection.reRange();
this.bottomRightCollection.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }
@ -29671,6 +29692,10 @@ BI.GridTable = BI.inherit(BI.Widget, {
if (this._width <= 0 || this._height <= 0) { if (this._width <= 0 || this._height <= 0) {
return; return;
} }
if (this._isNeedDigest === true) {
this._reRange();
this._isNeedDigest = false;
}
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -29728,10 +29753,12 @@ BI.GridTable = BI.inherit(BI.Widget, {
setColumnSize: function (columnSize) { setColumnSize: function (columnSize) {
this.options.columnSize = columnSize; this.options.columnSize = columnSize;
this._isNeedDigest = true;
}, },
setRegionColumnSize: function (regionColumnSize) { setRegionColumnSize: function (regionColumnSize) {
this.options.regionColumnSize = regionColumnSize; this.options.regionColumnSize = regionColumnSize;
this._isNeedDigest = true;
}, },
getColumnSize: function () { getColumnSize: function () {
@ -29744,11 +29771,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { if (items && this.options.items !== items) {
this._isNeedDigest = true;
this.options.items = items; this.options.items = items;
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && this.options.header !== header) {
this._isNeedDigest = true;
this.options.header = header; this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
@ -29763,6 +29792,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.restore(); this.bottomRightGrid.restore();
}, },
_reRange: function () {
this.topLeftGrid.reRange();
this.topRightGrid.reRange();
this.bottomLeftGrid.reRange();
this.bottomRightGrid.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }
@ -32356,8 +32392,10 @@ BI.ResizableTable = BI.inherit(BI.Widget, {
}; };
var stop = function (j, size) { var stop = function (j, size) {
self.resizer.setVisible(false); self.resizer.setVisible(false);
o.columnSize[j] = size; var columnSize = o.columnSize.slice();
self.table.setColumnSize(o.columnSize); columnSize[j] = size;
o.columnSize = columnSize;
self.table.setColumnSize(columnSize);
self.table.populate(); self.table.populate();
self._populate(); self._populate();
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE);

5
src/base/collection/collection.js

@ -335,6 +335,11 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return this._getMaxScrollTop(); return this._getMaxScrollTop();
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();

9
src/base/grid/grid.js

@ -123,6 +123,7 @@ BI.GridView = BI.inherit(BI.Widget, {
var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -173,7 +174,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[rowIndex] = child; renderedWidgets[count++] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -306,6 +307,11 @@ BI.GridView = BI.inherit(BI.Widget, {
this.options.estimatedRowSize = height; this.options.estimatedRowSize = height;
}, },
//重新计算children
reRange: function () {
this.renderRange = {};
},
restore: function () { restore: function () {
BI.each(this.renderedCells, function (i, cell) { BI.each(this.renderedCells, function (i, cell) {
cell.el.destroy(); cell.el.destroy();
@ -319,7 +325,6 @@ BI.GridView = BI.inherit(BI.Widget, {
populate: function (items) { populate: function (items) {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
this.restore();
} }
this._populate(); this._populate();
} }

17
src/base/table/table.collection.js

@ -175,7 +175,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () { _populateScrollbar: function () {
var o = this.options; var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -216,7 +217,8 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
_populateTable: function () { _populateTable: function () {
var self = this, o = this.options; var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength(); var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) { BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -247,7 +249,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -427,8 +429,10 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
return; return;
} }
if (this._isNeedDigest === true) { if (this._isNeedDigest === true) {
this._reRange();
this._digest(); this._digest();
} }
this._isNeedDigest = false;
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -523,6 +527,13 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
this.bottomRightCollection.restore(); this.bottomRightCollection.restore();
}, },
_reRange: function () {
this.topLeftCollection.reRange();
this.topRightCollection.reRange();
this.bottomLeftCollection.reRange();
this.bottomRightCollection.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }

15
src/base/table/table.grid.js

@ -357,6 +357,10 @@ BI.GridTable = BI.inherit(BI.Widget, {
if (this._width <= 0 || this._height <= 0) { if (this._width <= 0 || this._height <= 0) {
return; return;
} }
if (this._isNeedDigest === true) {
this._reRange();
this._isNeedDigest = false;
}
this._populateTable(); this._populateTable();
this._populateScrollbar(); this._populateScrollbar();
}, },
@ -414,10 +418,12 @@ BI.GridTable = BI.inherit(BI.Widget, {
setColumnSize: function (columnSize) { setColumnSize: function (columnSize) {
this.options.columnSize = columnSize; this.options.columnSize = columnSize;
this._isNeedDigest = true;
}, },
setRegionColumnSize: function (regionColumnSize) { setRegionColumnSize: function (regionColumnSize) {
this.options.regionColumnSize = regionColumnSize; this.options.regionColumnSize = regionColumnSize;
this._isNeedDigest = true;
}, },
getColumnSize: function () { getColumnSize: function () {
@ -430,11 +436,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { if (items && this.options.items !== items) {
this._isNeedDigest = true;
this.options.items = items; this.options.items = items;
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && this.options.header !== header) {
this._isNeedDigest = true;
this.options.header = header; this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
@ -449,6 +457,13 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.restore(); this.bottomRightGrid.restore();
}, },
_reRange: function () {
this.topLeftGrid.reRange();
this.topRightGrid.reRange();
this.bottomLeftGrid.reRange();
this.bottomRightGrid.reRange();
},
restore: function () { restore: function () {
this._restore(); this._restore();
} }

6
src/base/table/table.resizable.js

@ -219,8 +219,10 @@ BI.ResizableTable = BI.inherit(BI.Widget, {
}; };
var stop = function (j, size) { var stop = function (j, size) {
self.resizer.setVisible(false); self.resizer.setVisible(false);
o.columnSize[j] = size; var columnSize = o.columnSize.slice();
self.table.setColumnSize(o.columnSize); columnSize[j] = size;
o.columnSize = columnSize;
self.table.setColumnSize(columnSize);
self.table.populate(); self.table.populate();
self._populate(); self._populate();
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE);

Loading…
Cancel
Save