From wiki.ginstr.com
Jump to: navigation, search

gn:act_sortCollection

Description
Action used to sort collection of data in a target by single or multiple criteria.
Action returns
void

Action signatures

[gn:act_sortCollection]|[target;sortColumn,sortOrder;sortColumn,sortOrder;{n}]
Parameter Description
target target target to which format will be set.
sortColumn,sortOrder {n} Sorting pair which will be applied on data. There can be one or more sorting pairs defined. Sorting priority is higher from first pair defined in action to lowest at last pair (left to right).
  • sortColumn id of the column in rows variable.
  • Valid values:
    • hardcoded column id
  • sortOrder
  • Valid values:
    • ASC or regular - sorts ascending
    • DESC or reverse - sorts descending

Example

variables content
@variable/rowz = contains rows with columns a, b, c


variables.xml
<variable id="rowz" type="rows"></variable>
screen.xml
<FrameLayout
    android:id="@+id/exampleFrame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    gn:act_set="[gn:act_sortCollection]|[@variable/rowz;a,DESC;b,DESC]" />
after action execution
@variable/rowz = data is sorted by column a descending, then by column b descending