Difference between revisions of "lnbSortBy"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |arma 3 |2.06 |gr1= GUI Control - ListNBox |Sorts given multi-column ListNBox in the given column by either lnbText, lnbValue or lnbData in n...")
 
Line 8: Line 8:
  
 
|Sorts given multi-column ListNBox in the given column by either [[lnbText]], [[lnbValue]] or [[lnbData]] in normal or reversed order, using case-sensitive or case-insensitive comparison. Unlike the older <i>lnbSortByXXX</i> commands, this command supports Unicode characters out of the box. The `sortByType` option is one of <tt>"TEXT"</tt>, <tt>"VALUE"</tt> or <tt>"DATA"</tt>. When sorting by <tt>"VALUE"</tt>, the rows with the same [[lnbValue]] will additionally be sorted by [[lnbText]] in the order specified by `reversedOrder` flag.  
 
|Sorts given multi-column ListNBox in the given column by either [[lnbText]], [[lnbValue]] or [[lnbData]] in normal or reversed order, using case-sensitive or case-insensitive comparison. Unlike the older <i>lnbSortByXXX</i> commands, this command supports Unicode characters out of the box. The `sortByType` option is one of <tt>"TEXT"</tt>, <tt>"VALUE"</tt> or <tt>"DATA"</tt>. When sorting by <tt>"VALUE"</tt>, the rows with the same [[lnbValue]] will additionally be sorted by [[lnbText]] in the order specified by `reversedOrder` flag.  
 +
 +
{{Feature|Important|This command supports referencing control via IDC as well, but as with any use of IDC in UI [[Control]] commands, the [[dialog]] should be present, i.e. UI user interaction is created with [[createDialog]] rather than [[createDisplay]]}}
  
 
| [controlOrIDC, column] '''lnbSortBy''' [sortByType, reversedOrder, caseSensitive]
 
| [controlOrIDC, column] '''lnbSortBy''' [sortByType, reversedOrder, caseSensitive]

Revision as of 09:55, 16 May 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
GUI Control - ListNBox

Syntax

Syntax:
Syntax needed
Parameters:
[controlOrIDC, column]: Array
controlOrIDC: Control or Number - the listNBox control or its IDC
column: Number - column to sort (starts with 1)
[sortByType, reversedOrder, caseSensitive]: Array
sortByType (Optional): String - one of "TEXT", "VALUE" or "DATA". Default: "TEXT"
reversedOrder (Optional): Boolean - true for sorting in reversed order. Default: false
caseSensitive (Optional): Boolean - true for using case-sensitive comparison. Default: false
Return Value:
Return value needed

Examples

Example 1:
with uiNamespace do { lnb = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscListNBox", -1]; lnb ctrlSetPosition [0,0,1,1]; lnb ctrlCommit 0; lnbClear lb; { lnb lnbAddRow ["",_x select 0]; lnb lnbSetValue [[_forEachIndex, 1], _x select 1]; } forEach [["В",1],["Я",0],["Б",1],["Ю",0],["А",1]]; [lnb, 1] lnbSortBy ["VALUE", true, false]; };

Additional Information

See also:
lnbSortlnbSortByValuelbSortlbSortByValuetvSorttvSortByValuesort

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note