تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
12948 أدوات العرض

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
يونيو 18
5903
3
أغسطس 17
9072
0
يناير 25
1027
0
فبراير 24
1267
0
أغسطس 23
2395