Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4224 มุมมอง

Hello fellows, how you doing?

I build my custom template for invoice analysis and it's being displayed twice. The first one empty once any search was did and the second when it returns a search result... May could some one help me?


start: function() {
        var sup = this._super();
        var self = this;
        self.render();
    },
    /*render template passing no values*/
    render: function(){
        var self = this;
        var invoices = Invoices.call('dashboard_invoceis_action_id', []).then(function(result){
            self.$el.append(QWeb.render('InvoiceTemplate', {invoices: result}));
        });
    },
    do_search: function(event) {
        var self = this;
        if(event.which == 13) {
            var search_term = $(event.currentTarget).val();
            var invoice_id = $(event.currentTarget).data('export-id');
            var invoices = Invoices.call('do_search', [{'search_term':search_term}]).then(function(result){
                self.$el.append(QWeb.render('InvoiceTemplate', {invoices: result}));
            });
        }
    },

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,


            self.$el.append(QWeb.render('InvoiceTemplate', {invoices: result}));

this  appends in two functions in render(), do_search try to set in one method.


regards,

Silvestar


  

อวตาร
ละทิ้ง
ผู้เขียน

Thank you Silverstar

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 23
2612
0
มี.ค. 24
5887
2
ก.ย. 17
7388
0
ต.ค. 24
1191
Template Render Error แก้ไขแล้ว
1
ส.ค. 24
2120