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

Please help me here

this is in my template

<t t-set=”abcd” t-value=”my_function()” /> 
<t t-esc="abcd"/>

this is my java script

<script>
function my_function(){
var msg= 'Hello';
return msg;
}
</script>


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

<t t-set="count" t-value="window.my_function()" />

if you want to pass other function which is not availabe at window global object then pass it as args like

$(QWeb.render('my_tempalte', {my_function: widget.my_function}));
it will call by <t t-set="abcd" t-value="my_function()" />


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

do you solv this problem? 


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 22
11656
2
พ.ค. 21
8556
2
ก.พ. 19
10170
0
ก.ค. 18
3773
0
มิ.ย. 24
1011