diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-20 13:46:32 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-20 13:46:32 +0100 |
| commit | 215f66550805e81c8fa53125734fb3ee0e8a1f63 (patch) | |
| tree | fe63586d7ba4ccd856841c0c030a76ea39a061aa /addons/web_graph/static/src | |
| parent | fde3f47a2e21afbee6d7ec575590e97a05a3eb98 (diff) | |
[IMP] supports columns folding in pivottable (addon web_graph)
bzr revid: ged@openerp.com-20131120124632-ydjuvtcvou14qivo
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 6e9e20d943a..d99bffbb2d6 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -613,6 +613,55 @@ var PivotTable = instance.web.Widget.extend({ }); }, + fold_col: function (col_id) { + var self = this; + var col = this.get_col(col_id); + + _.each(col.children, function (child_col) { + self.remove_col(child_col); + }); + col.children = []; + + _.each(col.cells, function (cell) { + cell.td.css('display','table-cell'); + }); + col.expanded = false; + // row.html.find('.icon-minus-sign') + // .removeClass('icon-minus-sign') + // .addClass('icon-plus-sign'); + + var fold_levels = _.map(self.cols, function(g) {return g.path.length;}); + var new_groupby_length = _.max(fold_levels); + + this.data.col_groupby.splice(new_groupby_length); + this.make_top_headers(); + this.draw_top_headers(); + + + }, + + remove_col: function (col_id) { + var self = this; + var col = this.get_col(col_id); + + _.each(col.children, function (child_col) { + self.remove_col(child_col); + }); + + _.each(col.cells, function (cell) { + cell.td.remove(); + }); + // row.html.remove(); + removeFromArray(this.cols, col); + + // _.each(this.cols, function (col) { + // col.cells = _.filter(col.cells, function (cell) { + // return cell.row_id !== row_id; + // }); + // }); + }, + + }); }; |
