Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Contributor
Posts: 16
Registered: ‎12-16-2010
My Device: Not Specified
Accepted Solution

number of items in groupdatamodel sections

I have a listview that has attatched a groupedDataModel.

The groupedDataModel has 3 sections,

first section 5 items

second 6 items

third     8 items

 

How can I find the number of items in the groupdatamodel sections in QML ?

 

myList.dataModel.childCount(i);seems to  always return the number of sections(3) no matter what the value of i is .

Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: number of items in groupdatamodel sections

Have you tried datamodel.size()?

______________________________________________________
BB10-OAuth: GitHub
Contributor
Posts: 16
Registered: ‎12-16-2010
My Device: Not Specified

Re: number of items in groupdatamodel sections

I'm interested with the number of items in each section.

I'm trying to iterate over all the items in the datamodel ,if you now any other way to to this?

Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: number of items in groupdatamodel sections

I looked at the documenation but it doesn't look like it's possible. It would be nice to have a method getGroup(index) or something and that retrieves a QVariantList with all the items within that group.

______________________________________________________
BB10-OAuth: GitHub