summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-12-17 16:32:04 +0100
committerGery Debongnie <ged@openerp.com>2013-12-17 16:32:04 +0100
commit79250f0c077e3c463fd2d644b5fe398f82048a3f (patch)
treef90bcf1e51ae4b86cc72f3cdd79d1f43e63a3e4d /addons/web_graph/static/src/js/graph.js
parent9596340bc52235e1a835e30a2e1e02b7a92fceed (diff)
[REF] adds event handling to pivot table class (triggers 'redraw_required' and 'groupby_changed' event when necessary (addon web_graph)
bzr revid: ged@openerp.com-20131217153204-43la1m8eqw632j05
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
-rw-r--r--addons/web_graph/static/src/js/graph.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 912f56e79fc..6805bce1793 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -138,20 +138,24 @@ instance.web_graph.GraphView = instance.web.View.extend({
do_search: function (domain, context, group_by) {
var self = this,
- col_groupby = context.col_group_by || []; // get_col_groupby('ColGroupBy');
+ col_groupby = context.col_group_by || [];
if (group_by.length || col_groupby.length) {
this.groupby_mode = 'manual';
}
this.pivot_table.set_domain(domain);
+
+ var options;
if (this.groupby_mode === 'manual') {
- this.pivot_table.set_row_groupby(group_by);
- this.pivot_table.set_col_groupby(col_groupby);
+ options = {row: group_by, col: col_groupby};
} else {
- this.pivot_table.set_row_groupby(_.toArray(this.default_row_groupby));
- this.pivot_table.set_col_groupby(_.toArray(this.default_col_groupby));
+ options = {
+ row: _.toArray(this.default_row_groupby),
+ col: _.toArray(this.default_col_groupby),
+ };
}
+ this.pivot_table.set_groupby(options);
this.display_data();
},