Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
12953 Widoki

Hello, is there a way I can render a QWeb template template from Javascript? As an example, I have the following template:

 

<template id="theme.tp_remove_button"> 
    <a class="btn btn-default tp_delete">
        <i class="fa fa-minus"></i>
    </a>
</template>

Is there any way I can call it from my Javascript file in the frontend? I know that I can create static QWeb templates and render them, but that would mean that every piece of code I plan on redering on both the server and the client will need two separate templates!

Thank you for the help!

Awatar
Odrzuć
Najlepsza odpowiedź

var modal = qweb.render("your template", {                modal_title: modal_title,                modal_body: modal_body            });


or check the render function in qweb js


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 18
5908
3
sie 17
9074
0
sty 25
1032
0
lut 24
1273
0
sie 23
2399