Xml:
<record id=“rec_id” model="ir.ui.view">
<field name="name">Demo</field>
<field name="model">model.name</field>
<field name="arch" type="xml">
<form string=“Demo”>
<header>
<h1>
<table align="center"class="Demo_class">
<tr>
<td align="center">
<input type="button" id=“demo_id” string=“Demo Button” class=“find_button”/>
</td>
<tr>
</table>
</h1>
</header>
</form>
</field>
</record>
Js:
var DemoClass = form_common.FormWidget.extend(form_common.ReinitializeWidgetMixin, {
events : {
'click .find_button':'find_button',
},
init: function() {
this._super.apply(this, arguments);
}
find_button : function(){
console.log("Click Event Called")
},
});
问题:这是我的代码,我只想将click事件绑定到特定的CSS选择器“ .find_button”,但是此代码无效。任何人都可以帮助我解决此问题。