Как гласит заголовок, у меня есть следующее Table
:
<Table>
<columns>
<Column text="Name" width="200px" />
<Column text="Options" width="200px" />
</columns>
<ColumnListItem>
<cells>
</cells>
</ColumnListItem>
</Table>
со следующим Model
:
var exampleModel ="{
"Model" =[
0:{
"name":"FirstName",
"options":["0","1","2","3","4","5","6","7","8","9","10"]
},
1:{
"name":"SecondName",
"options":["0","1","2","3","4","5","6","7","8","9","10"]
},
2:{
"name":"ThirdName",
"options":["0","1","2","3","4","5","6","7","8","9","10"]
},
3:{
"name":"FourthName",
"options":["0","1","2","3","4","5","6","7","8","9","10"]
}
]
}
this.setData(exampleModel.Model); // for "exampleModel" bellow.
Я знаю, как перебирать " Модель "и отобразите все имена:
<Label text="{exampleModel>name }"/>
, однако для отображения всех опций, которые равны 10, мне нужно будет создать контейнер - и выполнить все 10 кнопок:
<items>
<SegmentedButtonItem text="{exampleModel>options/0}"/>
<SegmentedButtonItem text="{exampleModel>options/1}"/>
<SegmentedButtonItem text="{exampleModel>options/2}"/>
<SegmentedButtonItem text="{exampleModel>options/3}"/>
//.....etc till <SegmentedButtonItem text="{exampleModel>options/10}"/>
</items>
Вопрос : Есть ли способ иметь два цикла, которые позволили бы отображать все 10 кнопок вместо прямого доступа?
Как это должно выглядеть: ![Table Displayed](https://i.stack.imgur.com/YbPig.png)