Name
Listview.SortFunc -- determine how entries should be sorted (V1.2)
Function
This attribute can be used to set up a callback function that will be called whenever MUI Royale needs to sort the list entries. The callback function will receive two entries as arguments and it has to determine which entry should be put first.

The callback function you specify here will be called like a standard MUI Royale event callback, but with the following extra arguments:

Entry1:
This is a table containing all elements of a single listview row. As listviews can have more than one column, this table contains as many string elements as there are columns in your listview.

Entry2:
This is a table containing all elements of a single listview row. As listviews can have more than one column, this table contains as many string elements as there are columns in your listview.

SortColumn:
This contains the column index by which the list should be sorted. Columns are counted from 0 to the number of columns minus 1. See Listview.Sort for details.

Your callback function then has to return a value that indicates how the two entries should be aligned in the listview. If entry 1 should be placed before 2, your callback has to return -1. If entry 1 should be placed after entry 2, your callback has to return 1. If the two entries are the same, return 0.

Note that you always have to pass a string specifying the name of a Hollywood function to this attribute. Never pass the function directly but always pass the name of the function as a string!

Also note that you must also set up a notification on this attribute. Otherwise the callback function will never get called.

See Notifications for details.

Type
String

Applicability
ISGN


Show TOC