I try to add some new event dispathcer to Graph view (click on graph bar)
odoo.define('myaddon.upgrades', function (require) {
"use strict";
var GraphController = require('web.GraphController');
GraphController.include({
events: _.extend({}, GraphController.prototype.events, {
'click rect.nv-bar': '_onBarClick',
}),
_onBarClick: function(event){
console.log('bar clicked');
},
});
});
But _onBarClick never called. What's wrong? During debug GraphController I even can see, that it really has events list including its default events and my added event too. Also if I add dispatcher to rect.nv-bar with JQuery at Chrome debug console, as
$('rect.nv-bar').click(function(e){console.log('bar clicked');});
it works too. But something prevents it from run the way I quoted above. Maybe something inside the nvd3? How can I test it?