Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3 Besvarelser
15428 Visninger

 I would like to use t-if condition to check whether a field name (Ex.: 'Total Value') contains a string '**Total**'. I tried using:

t-if = 'Total' in a.name but it seems to check whether a.name is equal to 'Total'. 

Avatar
Kassér
Bedste svar

Hi,

Try it like this, it normally works

<t t-if="'Total' in a.name">

Avatar
Kassér
Forfatter

It works, thanks :)

Bedste svar

<t t-if="'Total' in a.name">

Correct me,If I am wrong
 Thank you


Avatar
Kassér
Bedste svar

My guess is that it should probably be unicode:

<t t-if="u'Total' in a.name">
Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
feb. 18
3482
0
feb. 18
3367
1
jul. 25
1801
1
maj 25
1889
1
apr. 25
2351