Problems with sorting in Multicolumn list :?:

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

toma21207
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 16, 2006 17:54

Problems with sorting in Multicolumn list :?:

Postby toma21207 » Wed Jun 28, 2006 13:42

I have problem when sorting column that is filled only with numbers, for example the number 11 is befoure number 2. Or some example of sorting:
11, 12, 13, 1, 20, 21, 22, 2....

I have solution, but I don't wont to do that way, if I write numbers like 01 ,02, 03... than it's work, but I need numbers in format 1, 2, 3....

Plese help... :shock:

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Thu Jun 29, 2006 05:56

There is no way to define your own sort function at the moment. It use a string sort and thus the only solution is to use 01, 02, ...

There's no way to do it even in 0.5.0 RC1.

Chocapic
Just popping in
Just popping in
Posts: 2
Joined: Tue Feb 21, 2006 15:19
Location: France
Contact:

Problems with sorting in Multicolumn list

Postby Chocapic » Fri Jun 30, 2006 14:26

We modified CEGUI's source code to achieve this.
One way to do it easily is to store not only the text but also a numeric value in the item and adapt sorting to use this number instead of the text when the user specifies that the item is numeric.
This solution also work for dates and other types of values where text is not suitable for sorting.

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Sat Jul 01, 2006 11:17

Setting the comparator object used to do the sorting per column seems another good solution. It might be one of 0.6 addition ;)


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests