I need to get the no of rows in a list view blackberry 10 cascades qml
? The list view data source model type is json
. I have tried this
ListItem.initialized ? ListItem.view.dataModel.childCount(ListItem.indexPath) : 0
But its displaying only 0 even the list view row count is more than 1.
My code
dataModel: groupdatamodel
listItemComponents: [
ListItemComponent {
type: "header"
Container {
preferredWidth: 748
layout: DockLayout { }
Label {
text: "Title"
base: SystemDefaults.TextStyles.TitleText
fontWeight: FontWeight.Bold
}
}
Label {
id: subtitle
text: groupdatamodel.size() + "Items"
textStyle {
base: SystemDefaults.TextStyles.SmallText
fontWeight: FontWeight.Bold
}
}
]