跳至内容
菜单
此问题已终结
1 回复
12855 查看

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


形象
丢弃
相关帖文 回复 查看 活动
1
6月 18
5836
3
8月 17
8984
0
1月 25
941
0
2月 24
1202
0
8月 23
2319