Skip to Main Content

Shuttle Sorting

I don't use shuttles very often in Apex, but they can come in handy.
A feature that I recently needed was to sort both the left and right columns of the shuttle at all times. Some googling led me to this page where user jariola had a javascript solution that works fine. I just added a dynamic action to make life easier.

In the example above, Shuttle 1 is unsorted and Shuttle 2 is sorted, both with the same data, so you can see the difference when you try them both.
Note 1: The Ordering buttons still work as intended, as long as you don't add/remove any items - then the column(s) will sort again.
Note 2: The dynamic action makes calls for the left and right columns, so you can sort either column or both.
Note 3: Numbers are sorted as text here. If that's not what you want, take a look here.

Source: https://community.oracle.com/message/9570151#9570151

Code

Page

Identification
Page ID
Name
Javascript
Function and Global Variable Declaration

Item

Identification
Sequence
Name
Display As
User Interface
Region
List Of Values
Display Extra Values
Display Null Value
List of values definition
Advanced
Warn on Unsaved Changes
Source
Source Used
Source Type

Item

Identification
Sequence
Name
Display As
User Interface
Region
List Of Values
Display Extra Values
Display Null Value
List of values definition
Advanced
Warn on Unsaved Changes
Source
Source Used
Source Type

Dynamic Action

Identification
Name
Execution Options
Sequence
When
Event
Selection Type
Item(s)
Advanced
Event Scope
True Action
Identification
Action
Settings
Code
Execution Options
Sequence
Fire On Initialization