I have been looking for a solution everywhere, but I can’t find it. So I better ask directly here. Hope someone can help me.
I want to create an application with JSON data. I divided the data by date. But I don’t know how to make a model for such data. all I know is the standard JSON model (according to the felgo and qt documents)
Here’s my JSON file data:
[
{"05112020": [{"lbl:":"Outcome","total":"20000"},
{"lbl:":"Fee","total":"12000"},
{"lbl:":"Others","total":"66000"}]
},
{"06112020": [{"lbl:":"Outcome","total":"20000"},
{"lbl:":"Fee","total":"12000"},
{"lbl:":"Others","total":"66000"}]
}
]
this is my code:
AppListView {
id: lv_hariIni
model: jsonModel // this is from JsonListModel
anchors.top: txt_hariIni.bottom
height: contentHeight
delegate: AppListItem {
height: leftItem.height
leftItem: AppText {
text: model["05112020"].lbl // "05112020" is Manual key for test
verticalAlignment: Text.AlignVCenter
padding: dp(8)
}
rightItem: AppText {
text: model["05112020"].total
verticalAlignment: Text.AlignVCenter
padding: dp(8)
}
showDisclosure: true
}
}
The result is “undefined
Thanks before and sorry I am new in Felgo