Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
11236 Vues

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
Ignorer
Meilleure réponse

<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
Ignorer
Meilleure réponse

do you solv this problem? 


Avatar
Ignorer
Publications associées Réponses Vues Activité
2
août 22
11834
2
mai 21
8692
2
févr. 19
10317
0
juil. 18
3937
0
juin 24
1130