Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3957 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 15
10972
0
thg 8 23
194
1
thg 11 22
3349
2
thg 7 22
12354
1
thg 2 22
2794