summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph_widget.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-02-26 14:04:24 +0100
committerGery Debongnie <ged@openerp.com>2014-02-26 14:04:24 +0100
commiteb1eb48ef39a7eabcf96a2d130ddf81c360b2b53 (patch)
tree7aa63184553f405c1f5b2969fe5b1741f2a3d678 /addons/web_graph/static/src/js/graph_widget.js
parente7306f2c4ad577fd94bbb28e1c7636ef6799bad7 (diff)
[IMP] optimizes pivot table so that it doesn't reload data when the groupbys have been changed in such a way that it should only fold some headers (addon web_graph)
bzr revid: ged@openerp.com-20140226130424-rtb5iof0c14caf56
Diffstat (limited to 'addons/web_graph/static/src/js/graph_widget.js')
-rw-r--r--addons/web_graph/static/src/js/graph_widget.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js
index f060e62fa8c..9498fbfc93c 100644
--- a/addons/web_graph/static/src/js/graph_widget.js
+++ b/addons/web_graph/static/src/js/graph_widget.js
@@ -151,6 +151,13 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
return;
}
+ if (!dom_changed && col_reduced && row_reduced) {
+ this.pivot.fold_with_depth(this.pivot.rows, row_gbs.length);
+ this.pivot.fold_with_depth(this.pivot.cols, col_gbs.length);
+ this.display_data();
+ return;
+ }
+
if (dom_changed || row_gb_changed || col_gb_changed) {
this.pivot.set(domain, row_gbs, col_gbs).then(this.proxy('display_data'));
}