Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3958 Visualizações

I want to get the anchor click event in sales order form in openerp I tried these


   

openerp.website_sale_extended = function(instance){

console.log('My module has been initialized'); //worked

var module = instance.website_sale_extended || {};

//-not working module.CustomWidget = instance.web.form.FieldChar.extend({

//-not working module.CustomWidget = instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin, {

module.CustomWidget = instance.web.Widget.extend({ //not working

events: {

'click a': 'rename_file',

'change input': function (e) {

console.log('changed');

}

},

rename_file : function () {

console.log('clicked');

/*var $anchor = $(this);

var data-field = $anchor.parent().attr('data-field');

console.log(data-field);

if(data-field == 'attachment'){

var html = $anchor.parent().parent().find(':td[data-field="answer_id"]').html();

console.log(html);

$anchor.attr('download',html);

}

*/

},

});

};


Not working with

instance.web.form.FieldChar.extend(

instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin, {

instance.web.Widget.extend(

So how can we bind a anchor click event in openerp (odoo ) 8 via javascript.

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
jul. 15
10974
0
ago. 23
194
1
nov. 22
3349
2
jul. 22
12358
1
fev. 22
2795