İçereği Atla
Menü
This question has been flagged
2 Cevaplar
10572 Görünümler

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>


Avatar
Vazgeç
Best Answer

<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()" />


Avatar
Vazgeç
Best Answer

do you solv this problem? 


Avatar
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
2
Ağu 22
11242
2
May 21
8088
2
Şub 19
9743
0
Tem 18
3403
0
Haz 24
657