From eb1eb48ef39a7eabcf96a2d130ddf81c360b2b53 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 14:04:24 +0100 Subject: [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 --- addons/web_graph/static/src/js/graph_widget.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/web_graph/static/src/js/graph_widget.js') 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')); } -- cgit v1.2.3