hi guys, i have a question about using Each method with different data structure.
we often use Each with simple data structure like this.
items: [ { name: "Jake", age: 24 }, { name: "Julie", age: 25 }]
but what about using it with data structure like this.
items: [ {from: {name: "Jake", age: 24 }, to: {name: "Julie", age: 25 }}]
i’m falling to reach my data when i try the second type of data structure.
this is what i’m trying so far , and this is a full reproduction of my case, in my app this data is passed via router parameter.
<App>
<DockPanel>
<JavaScript>
var Observable = require("FuseJS/Observable");
exports.data = Observable(
{"driverSalary":15,"points":0,"missionType":"DELIVERY","brandLogoEnum":null,"carModel":"","missionReference":"KWMAbK1","missionStatusEnum":"NOT_ASSIGNED","startDate":"2017-05-24T15:00:00.000Z","endDate":"2017-05-24T15:46:00.000Z","missionStepDescription":"concession - client","meetingSet":[{"from":{"address":"29 rue frémicourt 75015 Paris","waitingTime":10,"arrivalDateTime":"2017-05-24T15:00:00.000Z"},"to":{"address":"130 Rue de Rivoli, 75001 Paris, France","waitingTime":10,"arrivalDateTime":"2017-05-24T15:36:00.000Z"},"travelTime":26}],"infoForDriver":null,"customerFirstName":"","customerLastName":"","customerPhoneNumber":null},{"driverSalary":15,"points":0,"missionType":"DELIVERY","brandLogoEnum":null,"carModel":"","missionReference":"8CNQNjs","missionStatusEnum":"NOT_ASSIGNED","startDate":"2017-05-24T15:23:00.000Z","endDate":"2017-05-24T16:10:00.000Z","missionStepDescription":"concession - client","meetingSet":[{"from":{"address":"29 rue frémicourt 75015 Paris","waitingTime":10,"arrivalDateTime":"2017-05-24T15:23:00.000Z"},"to":{"address":"130 Rue de Rivoli, 75001 Paris, France","waitingTime":10,"arrivalDateTime":"2017-05-24T16:00:00.000Z"},"travelTime":27}],"infoForDriver":null,"customerFirstName":"","customerLastName":"","customerPhoneNumber":null}
)
</JavaScript>
<Grid Height="50" Color="Green" Dock="Top">
<Text Value="repro" TextColor="White" Font="Bold" FontSize="20" Alignment="Center" TextAlignment="Center"/>
</Grid>
<ScrollView>
<StackPanel ItemSpacing="10">
<!-- testing the first data -->
<Text Value="{data.driverSalary}"/>
<Each Items="{data.meetingSet}">
<Rectangle Height="100" Margin="10" CornerRadius="10" Color="Blue">
<Match Value="{}">
<Case String="from">
<Text Value="blaaalaa"/>
</Case>
<Case String="to">
<Text Value="skqldhqs"/>
</Case>
</Match>
</Rectangle>
</Each>
</StackPanel>
</ScrollView>
</DockPanel>
</App>