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
Contributor
Posts: 12
Registered: ‎06-11-2012
My Device: 9900
My Carrier: Telus
Accepted Solution

GroupDataModel - Set Listview Item, Description and right element

Hi,

 

I have a QVariantMap as shown below:

 

firstname = ""

lastname = ""

employee number = ""

jobtitle = ""

salary = ""

 

I can sort the header by the employee number rather easily but Im having trouble including all of the other information. This is done all via C++.

 

Is there a way to set an element in the map (such as the job title) in the description and put the salary on the right side of the element?

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: GroupDataModel - Set Listview Item, Description and right element

For the sorting part, you want to do something like this:

 

dataModel.setSortingKeys(QStringList() << "employee number" << "lastname" << "firstname");

 

For the rest of it, I've only actually setup ListViews using StandardListItem from the QML side of things.  Over there, you just bind its properties to the various keys from your map.  Not sure offhand how to do the equivalent in C++, since I've only done pure-C++ ListView setups when using entirely custom list item controls.

Contributor
Posts: 12
Registered: ‎06-11-2012
My Device: 9900
My Carrier: Telus

Re: GroupDataModel - Set Listview Item, Description and right element

Yes your right, to see the C++ implementation check out the cascades cookbook sample app!

 

https://developer.blackberry.com/cascades/sampleapps/