Browse Source

Merge pull request #26 in FUI/fineui from ~YOUNG/fineui:master to master

* commit '506d9ee573440db26895de45db7b1b9d9ca71a15':
  dynamic tree
es6
guy 8 years ago
parent
commit
7cde39db62
  1. 23
      bi/case.js
  2. 23
      src/case/table/table.dynamicsummarytree.js

23
bi/case.js

@ -9749,12 +9749,18 @@ BI.DynamicSummaryTreeTable = BI.inherit(BI.Widget, {
}); });
this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, function () { this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, function () {
o.regionColumnSize = this.getRegionColumnSize(); o.regionColumnSize = this.getRegionColumnSize();
o.columnSize = this.getColumnSize(); var columnSize = this.getColumnSize();
var length = o.columnSize.length - columnSize.length;
o.columnSize = columnSize.slice();
o.columnSize.splice(columnSize.length, length, "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, arguments); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, arguments);
}); });
this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, function () { this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, function () {
o.regionColumnSize = this.getRegionColumnSize(); o.regionColumnSize = this.getRegionColumnSize();
o.columnSize = this.getColumnSize(); var columnSize = this.getColumnSize();
var length = o.columnSize.length - columnSize.length;
o.columnSize = columnSize.slice();
o.columnSize.splice(columnSize.length, length, "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, arguments); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, arguments);
}); });
}, },
@ -9796,7 +9802,7 @@ BI.DynamicSummaryTreeTable = BI.inherit(BI.Widget, {
}, },
getColumnSize: function () { getColumnSize: function () {
return this.table.getColumnSize(); return this.options.columnSize;
}, },
setRegionColumnSize: function (columnSize) { setRegionColumnSize: function (columnSize) {
@ -9991,12 +9997,19 @@ BI.extend(BI.DynamicSummaryTreeTable, {
}); });
if (cols.length > 0) { if (cols.length > 0) {
var nHeader = [], nItems = [];
BI.each(header, function (i, node) { BI.each(header, function (i, node) {
BI.removeAt(node, cols); var nNode = node.slice();
BI.removeAt(nNode, cols);
nHeader.push(nNode);
}); });
BI.each(items, function (i, node) { BI.each(items, function (i, node) {
BI.removeAt(node, cols); var nNode = node.slice();
BI.removeAt(nNode, cols);
nItems.push(nNode);;
}); });
header = nHeader;
items = nItems;
} }
return {items: items, header: header, deletedCols: cols}; return {items: items, header: header, deletedCols: cols};
} }

23
src/case/table/table.dynamicsummarytree.js

@ -91,12 +91,18 @@ BI.DynamicSummaryTreeTable = BI.inherit(BI.Widget, {
}); });
this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, function () { this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, function () {
o.regionColumnSize = this.getRegionColumnSize(); o.regionColumnSize = this.getRegionColumnSize();
o.columnSize = this.getColumnSize(); var columnSize = this.getColumnSize();
var length = o.columnSize.length - columnSize.length;
o.columnSize = columnSize.slice();
o.columnSize.splice(columnSize.length, length, "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, arguments); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE, arguments);
}); });
this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, function () { this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, function () {
o.regionColumnSize = this.getRegionColumnSize(); o.regionColumnSize = this.getRegionColumnSize();
o.columnSize = this.getColumnSize(); var columnSize = this.getColumnSize();
var length = o.columnSize.length - columnSize.length;
o.columnSize = columnSize.slice();
o.columnSize.splice(columnSize.length, length, "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, arguments); self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE, arguments);
}); });
}, },
@ -138,7 +144,7 @@ BI.DynamicSummaryTreeTable = BI.inherit(BI.Widget, {
}, },
getColumnSize: function () { getColumnSize: function () {
return this.table.getColumnSize(); return this.options.columnSize;
}, },
setRegionColumnSize: function (columnSize) { setRegionColumnSize: function (columnSize) {
@ -333,12 +339,19 @@ BI.extend(BI.DynamicSummaryTreeTable, {
}); });
if (cols.length > 0) { if (cols.length > 0) {
var nHeader = [], nItems = [];
BI.each(header, function (i, node) { BI.each(header, function (i, node) {
BI.removeAt(node, cols); var nNode = node.slice();
BI.removeAt(nNode, cols);
nHeader.push(nNode);
}); });
BI.each(items, function (i, node) { BI.each(items, function (i, node) {
BI.removeAt(node, cols); var nNode = node.slice();
BI.removeAt(nNode, cols);
nItems.push(nNode);;
}); });
header = nHeader;
items = nItems;
} }
return {items: items, header: header, deletedCols: cols}; return {items: items, header: header, deletedCols: cols};
} }

Loading…
Cancel
Save