Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
10567 Zobrazení

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
Zrušit
Nejlepší odpověď

<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
Zrušit
Nejlepší odpověď

do you solv this problem? 


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
srp 22
11239
2
kvě 21
8081
2
úno 19
9726
0
čvc 18
3400
0
čvn 24
656