Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
12966 Переглядів

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!

Аватар
Відмінити
Найкраща відповідь

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


or check the render function in qweb js


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
черв. 18
5915
3
серп. 17
9081
0
січ. 25
1036
0
лют. 24
1279
0
серп. 23
2405