summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2011-10-04 11:47:38 +0200
committerFabien Meghazi <fme@openerp.com>2011-10-04 11:47:38 +0200
commitf76b2f55aefa003ce1fd918734fb118ea3d4299d (patch)
treee47364ce85341ee897ba987748bc5c83c8789660 /addons/web_graph/static/src
parent8dc80c7c7cb9bc63eab4daa0eeb93d9505a32bce (diff)
parente2b6e03c3c6ffe3c6e2ed34166b66f953ba35495 (diff)
[MERGE] ViewManager now triggers do_search() in on_mode_switch()
The views doesn't have to worry about the search in do_show(). They just have to listen to do_search() if they are searchable. bzr revid: fme@openerp.com-20111004094738-at91ab6a2kkxf8bq
Diffstat (limited to 'addons/web_graph/static/src')
-rw-r--r--addons/web_graph/static/src/js/graph.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 08ceeddc2d9..ffdec860906 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -29,7 +29,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
this.group_field = null;
},
do_show: function () {
- // TODO: re-trigger search
this.$element.show();
},
do_hide: function () {
@@ -79,9 +78,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
}
}, this);
this.ordinate = this.columns[0].name;
-
- this.dataset.read_slice(
- this.list_fields(), {}, $.proxy(this, 'schedule_chart'));
},
schedule_chart: function(results) {
var self = this;
@@ -366,24 +362,14 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
});
},
- do_search: function(domains, contexts, groupbys) {
- var self = this;
- this.rpc('/web/session/eval_domain_and_context', {
- domains: domains,
- contexts: contexts,
- group_by_seq: groupbys
- }, function (results) {
- // TODO: handle non-empty results.group_by with read_group?
- if(!_(results.group_by).isEmpty()){
- self.abscissa = results.group_by[0];
- } else {
- self.abscissa = self.first_field;
- }
- self.dataset.read_slice(self.list_fields(), {
- context: results.context,
- domain: results.domain
- }, $.proxy(self, 'schedule_chart'));
- });
+ do_search: function(domain, context, group_by) {
+ // TODO: handle non-empty group_by with read_group?
+ if (!_(group_by).isEmpty()) {
+ this.abscissa = group_by[0];
+ } else {
+ this.abscissa = this.first_field;
+ }
+ this.dataset.read_slice(this.list_fields(), {}, $.proxy(this, 'schedule_chart'));
}
});
};