summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph_view.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-01-16 10:55:49 +0100
committerGery Debongnie <ged@openerp.com>2014-01-16 10:55:49 +0100
commit588e5413872c5c50ba9f48d4fd094ae1ba05e3c7 (patch)
treeccb2afa004b8df916625573e34166e83584a8523 /addons/web_graph/static/src/js/graph_view.js
parent74d6e75007ea089d79190e58a2579aaa8cd46060 (diff)
[FIX] fixes some issues with the col_group_bys in searchbar (main problem was that do_search is called twice when the user swap axis) (addon web_graph)
bzr revid: ged@openerp.com-20140116095549-3f2hbyzj32nuj147
Diffstat (limited to 'addons/web_graph/static/src/js/graph_view.js')
-rw-r--r--addons/web_graph/static/src/js/graph_view.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/graph_view.js b/addons/web_graph/static/src/js/graph_view.js
index c2b3979199f..91fcefaf1b8 100644
--- a/addons/web_graph/static/src/js/graph_view.js
+++ b/addons/web_graph/static/src/js/graph_view.js
@@ -78,17 +78,23 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);
this.graph_widget.appendTo(this.$el);
this.graph_widget.on('groupby_changed', this, this.proxy('register_groupby'));
+ this.graph_widget.on('groupby_swapped', this, this.proxy('swap_groupby'));
this.ViewManager.on('switch_mode', this, function (e) { if (e === 'graph') this.graph_widget.reload(); });
return;
}
+ if (this.swapped) {
+ this.swapped = false;
+ return;
+ }
+
this.graph_widget.set(domain, group_by, col_group_by);
},
get_col_groupbys_from_searchview: function () {
var facet = this.search_view.query.findWhere({category:'ColGroupBy'}),
- groupby_list = facet ? facet.attributes.values : [];
- return _.map(groupby_list, function (g) { return g.value.attrs.context.col_group_by; });
+ groupby_list = facet ? facet.values.models : [];
+ return _.map(groupby_list, function (g) { return g.attributes.value.attrs.context.col_group_by; });
},
do_show: function () {
@@ -132,6 +138,11 @@ instance.web_graph.GraphView = instance.web.View.extend({
}
},
+ swap_groupby: function () {
+ this.swap = true;
+ this.register_groupby();
+ },
+
make_row_groupby_facets: function(groupbys) {
return {
category:'GroupBy',