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
Developer
Posts: 134
Registered: ‎02-24-2013
My Device: BlackBerry Z10 LE
My Carrier: Telcel

How can I move an element from my ListView

[ Edited ]

Hi Guys.

 

I have a json database but it is not sorted, so I want to sort it manually using the ListItemData.title, but I don't know how can I change the index position, and if it have to be changed in the datamodel, or in the DataSource.

 

Someone could help me?

 

Thanks!

Developer
Posts: 1,635
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How can I move an element from my ListView

You could do something like this

 

.hpp file

 

bb::cascades::GroupDataModel *m_model;

 

.cpp file

 

    QStringList sort;

    sort << "title";
    m_model->setSortingKeys(sort);

    m_model->setSortedAscending(true);