You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds sorting: :external, leaving row order to the caller (e.g. SQL
ordering). Sortable headers render plain links built by a required
sort_href_builder proc, which receives the column id and the
direction the link requests next (NONE and DESC cycle to ASC, ASC
to DESC). aria-sort renders exactly as in client mode.
External tables emit no client sort metadata: no data-sort-strategy
on headers, no per-cell sort values, and no toggleSort binding. The
data-table element additionally ignores connect and toggleSort when
the data-external-sorting attribute is present.
Diverges from Primer React, whose externalSorting keeps sort
buttons and an onToggleSort callback; links suit server rendering
and work without JavaScript.
Copy file name to clipboardExpand all lines: static/arguments.json
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6088,6 +6088,18 @@
6088
6088
"default": "`nil`",
6089
6089
"description": "Sort direction for the initially sorted column. Options: :ASC, :DESC"
6090
6090
},
6091
+
{
6092
+
"name": "sorting",
6093
+
"type": "Symbol",
6094
+
"default": "`:client`",
6095
+
"description": "How sorting is performed. `:client` sorts rows in Ruby for the initial render and re-sorts in the browser. `:external` leaves row order to the caller (e.g. SQL ordering): sortable headers become links built by `sort_href_builder`, and `initial_sort_column`/`initial_sort_direction` only drive the rendered sort state. Options: :client, :external"
6096
+
},
6097
+
{
6098
+
"name": "sort_href_builder",
6099
+
"type": "Proc, nil",
6100
+
"default": "`nil`",
6101
+
"description": "`->(column_id, direction)` returning the URL a sortable header links to, where `direction` is the direction the link requests next. Required when `sorting: :external` and any column is sortable."
6102
+
},
6091
6103
{
6092
6104
"name": "divider",
6093
6105
"type": "Boolean",
@@ -6306,6 +6318,12 @@
6306
6318
"default": "`:ASC`",
6307
6319
"description": "select [:ASC, :DESC, :NONE] Specify the sort direction for the header."
6308
6320
},
6321
+
{
6322
+
"name": "href",
6323
+
"type": "String, nil",
6324
+
"default": "`nil`",
6325
+
"description": "When given, the header renders a plain sort link to this URL instead of the client-side sort button (used for external sorting)."
0 commit comments