Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

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

By
zbik
on 6/19/15, 4:45 AM 776 views

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.


1

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 6/19/15, 7:02 AM

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.')
},
});
}



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/19/15, 4:45 AM
Seen: 776 times
Last updated: 6/3/16, 4:02 AM