summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/pivot_table.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-04-02 17:08:17 +0200
committerGery Debongnie <ged@openerp.com>2014-04-02 17:08:17 +0200
commit729cd2ce023d8919aa1b250a4b51bf416cc12117 (patch)
tree5ed1e27a49231427f5d724dd51ac024d546ac823 /addons/web_graph/static/src/js/pivot_table.js
parentc138b778df3055dad9e1add03deaf5b519e7581f (diff)
[FIX] correct the expand functionality to avoid creating rows/cols in the other dimension of an unfolding action (addon web_graph)
bzr revid: ged@openerp.com-20140402150817-5s8drvhbznxq0hh9
Diffstat (limited to 'addons/web_graph/static/src/js/pivot_table.js')
-rw-r--r--addons/web_graph/static/src/js/pivot_table.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/pivot_table.js b/addons/web_graph/static/src/js/pivot_table.js
index 824b41a6b25..9231765c485 100644
--- a/addons/web_graph/static/src/js/pivot_table.js
+++ b/addons/web_graph/static/src/js/pivot_table.js
@@ -223,7 +223,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
data = data.slice(other_gbs.length + 1, data.length);
_.each(data, function (data_pt) {
self.make_headers_and_cell(
- data_pt, header.root.headers, other_root.headers, 1, header.path);
+ data_pt, header.root.headers, other_root.headers, 1, header.path, true);
});
header.expanded = true;
header.children.forEach(function (child) {
@@ -271,12 +271,15 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
});
},
- make_headers_and_cell: function (data_pts, row_headers, col_headers, index, prefix) {
+ make_headers_and_cell: function (data_pts, row_headers, col_headers, index, prefix, expand) {
var self = this;
data_pts.forEach(function (data_pt) {
var row_value = (prefix || []).concat(data_pt.attributes.value.slice(0,index));
var col_value = data_pt.attributes.value.slice(index);
+ if (expand && !_.find(col_headers, function (hdr) {return _.isEqual(col_value, hdr.path);})) {
+ return;
+ }
var row = self.find_or_create_header(row_headers, row_value, data_pt);
var col = self.find_or_create_header(col_headers, col_value, data_pt);