In some platforms, like Process Screening, the TableBoxes are set up to automatically sort by a column when that column's header is clicked.
When I just create my own tableBox, this doesn't happen, I have to right-click and "Sort by Column Header".
How can I configure my TableBoxes (using JSL) to automatically sort by column when the column's header is clicked?
You are looking for this option for a table box tb:
tb << Set Click Sort(1);
To have a full example:
New Window( "Mountains",
tb = Table Box(
String Col Edit Box(
"Mountain",
{"K2", "Delphi", "Kilimanjaro",
"Grand Teton"}
),
Number Col Edit Box(
"Elevation (meters)",
{8611, 681, 5895, 4199}
),
Plot Col Box( "", {8611, 681, 5895, 4199} )
)
);
// optional forced sorting
tb << Sort by Column(1,1);
wait(2);
tb << Sort by Column(1,0);
wait(2);
tb << Sort by Column(2,1);
// What you want: Sort on Click
tb << Set Click Sort (1);