Help

2

How can I include and apply javascript click for inherited backend?

Avatar
Zbik

I need to realize this function for backend form view:

inherited XML:

<div id="target">Click here</div>

Javascript:

$( "#target" ).click(function() {
    alert( "Handler for .click() called." );
});


Thanks in advance for example or link.


Avatar
Discard
1 Answer
2
Avatar
Zbik
Best Answer

I found a solution:

Javascript:

openerp.my_module= function(instance) {
instance.web.FormView = instance.web.FormView.extend({
events: {
   'click #target': 'button_clicked',
},
button_clicked: function() {
  alert('Handler for .click() called.')
},
});
}



Avatar
Discard