Hi,
i have a problem while creating items inside an item:
<Each Items="{vItems}">
<StackPanel>
<Text Value="{name}"/>
<StackPanel Margin="20">
<Each Items="{innerItem}">
<Text Value="{innerName}"/>
</Each>
</StackPanel>
</StackPanel>
</Each>
if i try to do it all at once it works without any problem:
vItem = Observable();
vItem.add({name: "value1", innerItem: Observable({innerName: "1"}, {innerName: "2"})});
but i have 2 questions:
- How to add the inner items after creating the parent one?
what i tried and didn’t work:
vItem = Observable();
vItem.add({name: "value1", innerItem: Observable()});
//something like:
vItem.value[0].innerItem.add({innerName: "1"});
vItem.value[0].innerItem.add({innerName: "2"});
- How to add the inner values as a JSON?
what i tried and didn’t work:
var jsonText = '{innerName: "1"},{innerName: "2"}';
vItem.add({name: "value1", innerItem: Observable(JSON.parse(jsonText))});