Skip to Content
Menú
This question has been flagged
2 Respostes
10560 Vistes

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
Descartar
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
Descartar
Best Answer

do you solv this problem? 


Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
d’ag. 22
11222
2
de maig 21
8065
2
de febr. 19
9702
0
de jul. 18
3397
0
de juny 24
643