Я пытаюсь установить видимость метки, содержащейся в ListView. Если str01 пуст, мне нужно скрыть Метку
page.ts
items.push({
str00: var00,
str01: var01,
str02: var02,
str03: var03
});
console.log(items);
myViewModel.set("items", items);
console.log (items) - часть страницы вывода
[{
"str00": [
"VALUE00"
],
"str01": [
""
],
"str02": [
"4.00"
],
"str03": [
"VALUE03"
]
}, {
"str00": [
"AAAAA"
],
"str01": [
"VALUE01"
],
"str02": [
"15.00"
],
"str03": [
"AB09UT"
]
}, ...
. xml со всеми ListView
<ListView items="{{ items }}">
<ListView.itemTemplate>
<StackLayout>
<GridLayout columns="8,120,*" rows="80" height="80" horizontalAlignment="center" borderRadius="8">
<StackLayout col="0" class="" backgroundColor="lightgray"></StackLayout>
<StackLayout col="1" class="" backgroundColor="" orientation="horizontal" style="padding:20px 0;">
<GridLayout rows="auto,auto" verticalAlignment="center">
<Label text="titl." fontStyle="italic" style="padding-bottom:0;" horizontalAlignment="center" row="0"/>
<Label text="{{ str02 }}" style="font-weight: bold; font-size: 18px;padding-top:0;" horizontalAlignment="center" textWrap="true" row="1"/>
</GridLayout>
</StackLayout>
<StackLayout col="2" class="" backgroundColor="" orientation="horizontal">
<GridLayout rows="auto,auto,auto" verticalAlignment="center" backgroundColor="" class="bleft">
<Label text="{{ 'Title: ' + str00 }}" style="padding-bottom:0;" horizontalAlignment="left" style="padding:0;" row="0"/>
<Label text="{{ 'Title: ' + str01 }}" style="padding-bottom:0;" horizontalAlignment="left" style="padding:0;" visibility="{{ str01, str01.length === 0 ? 'hidden' : 'visible' }}" row="1"/>
<Label text="{{ 'Title: ' + str03 }}" style="padding-bottom:0;" horizontalAlignment="left" style="padding:0;" row="2"/>
</GridLayout>
</StackLayout>
</GridLayout>
</StackLayout>
</ListView.itemTemplate>
</ListView>
видимость не работает. Я использую эмулятор Android.
Как я могу это решить?
Большое спасибо!
спасибо