我的代码是
<ListView dataSource={this.state.dataSource}
showsVerticalScrollIndicator={false} renderRow={(rowData) =>
<CardView cornerRadius={5} style={styles.fabopencard}>
<TouchableOpacity onPress={this.FunctionToOpenDescription.bind(this, rowData.id)}>
<Text style={styles.rowViewContainer}>{rowData.display_name}
</Text>
<ListView dataSource={this.state.dataSource1}
showsVerticalScrollIndicator={false} renderRow={(rowData) => rowData.servicedetails.map(servicedetail => {
<Text>{servicedetail.display_name}</Text>
})
}/>
</TouchableOpacity>
</CardView>
}
enableEmptySections={true}/>
我要访问另一个数组中的一个数组
PFB数组格式:
{ "error":1, "id": 001, "display_name": "demos", "count": 6, "records":[
{
"id": 1,
"name":"abc",
"servicedetails":[
{
"a": 1,
"b": 2,
}, {
"a": 1,
"b": 2,
}, {
"a": 1,
"b": 2,
},
]
}, {
"id": 1,
"name":"xyz",
"servicedetails":[
{
"a": 1,
"b": 2,
}, {
"a": 1,
"b": 2,
}, {
"a": 1,
"b": 2,
},
]
}
] }
我想访问servicedetails数组并将其显示在listview中。