X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Fweb_graph%2Fstatic%2Fsrc%2Fjs%2Fgraph.js;h=9806e7011a4ae081f71070ce07dc5e13dd6ea155;hb=e1e676d737a2f682ed6a106e99b63a4dd377c5d5;hp=c155337d90ea9b1a0e606f623e96c8468d200cfd;hpb=69f6efa000e5368462fa3a0c66577d0f405334f0;p=odoo%2Fodoo.git diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index c155337..9806e70 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -18,7 +18,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ view_type: 'graph', init: function(parent, dataset, view_id, options) { - this._super(parent); + this._super(parent, dataset, view_id, options); this.dataset = dataset; this.model = new instance.web.Model(dataset.model, {group_by_no_leaf: true}); this.search_view = parent.searchview; @@ -119,6 +119,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ if (!this.graph_widget.enabled) { this.graph_widget.activate_display(); + this.ViewManager.on('switch_mode', this, function () {this.graph_widget.pivot.update_data(); }); } }, @@ -272,6 +273,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({ display_data: function () { this.$('.graph_main_content svg').remove(); + this.$('.graph_main_content div').remove(); this.table.empty(); if (this.visible_ui) { @@ -280,8 +282,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({ this.$('.graph_header').css('display', 'none'); } if (this.pivot.no_data) { - var msg = 'No data available. Try to remove any filter or add some data.'; - this.table.append($('' + msg + '')); + this.$('.graph_main_content').append($(QWeb.render('graph_no_data'))); } else { var table_modes = ['pivot', 'heatmap', 'row_heatmap', 'col_heatmap']; if (_.contains(table_modes, this.mode)) {