Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
10899 Visninger

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
Kassér
Bedste svar

<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
Kassér
Bedste svar

do you solv this problem? 


Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
aug. 22
11491
2
maj 21
8361
2
feb. 19
10017
0
jul. 18
3599
0
jun. 24
880