Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
10928 Visualizzazioni

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
Abbandona
Risposta migliore

<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
Abbandona
Risposta migliore

do you solv this problem? 


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
ago 22
11508
2
mag 21
8391
2
feb 19
10041
0
lug 18
3625
0
giu 24
897