ListView.Sort
ListView.Sort
Hello,
In a listview with multiple columns .Sort seems to sort the listview erratically. In any case I was hoping this method would allow me to specify which column to sort content by, but it currently does not seem to allow for this.
In a listview with multiple columns .Sort seems to sort the listview erratically. In any case I was hoping this method would allow me to specify which column to sort content by, but it currently does not seem to allow for this.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: ListView.Sort
This is a bug as well. It's fixed now and Listview.Sort also accepts a new argument now which allows you to specify the column index according to which the list view should be sorted.
Re: ListView.Sort
Still doesn't appear to be working, also the method of sorting needs to selectable or the developer can write their own custom sort.
A-Z
Z-A
0-9
9-A
Date sorting
Etc...
A-Z
Z-A
0-9
9-A
Date sorting
Etc...
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
Re: ListView.Sort
Experiencing mixed-success with this atm, I think tags are getting the way as well of the sort.
Certainly need a way to reverse-sort.
Certainly need a way to reverse-sort.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
Re: ListView.Sort
Date sorting isn't great either... Day 01 listed before 10.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: ListView.Sort
Well, yeah, this is just how MUI's default sorting algorithm works. For fine-tuned sort control I'd need to add support for custom sorting through a callback function. Might be a useful enhancement for your needs.
Re: ListView.Sort
Yes that would be cool, absolutely what I was recommending.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: ListView.Sort
Will be added for next version.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: ListView.Sort
- New: Added Listview.SortFunc attribute; this allows you to specify a custom callback function
that will be called whenever your listview requires sorting; this allows you to customize
listview sorting, e.g. implement reverse alphabetical sorting or sorting by other customized
criteria (requested by Richard Lake)
Re: ListView.Sort
Firstly, thanks for 1.2 - however hitting a problem atm, I think I have the implementation correct, but only partial arguments are being sent to the callback function, a table representing Entry1 - which I am unable to debugprint the first element. Any light you can shed?
GUI Block:
Event Block:
Call Back Function:
GUI Block:
Code: Select all
<vgroup title="Search" disabled="true" id="searchresults-pagetab">
<listview id="appstore-search-results" cyclechain="1" minlineheight="40" notify="active;titleclick;sortfunc">
<column title="Title" minwidth="35"/>
<column title="Category" minwidth="23"/>
<column title="Version" minwidth="10"/>
<column title="Size" minwidth="10"/>
<column title="Rating" minwidth="18"/>
<column hidden="true"/>
<column hidden="true"/>
<column hidden="true"/>
</listview>
</vgroup>
Code: Select all
Case "TitleClick"
If msg.id ="news-list" and msg.triggervalue = 0
;ignore column 1 in the news-list listview
Else
mui.DoMethod(msg.id,"Sort",msg.triggervalue)
EndIf
Code: Select all
Function ListViewSort(a,b,column)
debugprint(a) ; OUTPUTS typical table: Table: 0x54ce5df8
debugprint(b) ; OUTPUTS Nil
debugprint(column) ; OUTPUTS Nil
debugprint(a[0]) ; Instead of Outputing first string element of the table it outputs nothing
Return(value)
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com