在某些平台(例如“過程篩選”)中,將“表格框”設置為在單擊列標題時按列自動排序。
當我只創建自己的tableBox時,不會發生這種情況,我必須右鍵單擊並“按列標題排序”。
單擊列標題時,如何配置TableBox(使用JSL)以按列自動排序?
您正在為錶框tb尋找此選項:
tb << Set Click Sort(1);
舉一個完整的例子:
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);