Skip to content

Dynamic Sortable Table

Build sortable data tables that keep filtering, sorting, and paging understandable instead of turning list state into guesswork.

A dynamic sortable table is really a stateful list: the user changes sort order, often combines it with filters, and expects the current view to remain understandable while data moves around. In Wappler, the goal is to keep that sorting logic declarative so the table stays predictable instead of becoming a pile of manual click handlers and hidden assumptions.

Sort is part of state
Users need to know what column is active and which direction the table is using.
Tables rarely sort alone
Sorting usually lives beside filtering, paging, and empty states, so the pattern should be designed as a whole.
Make the active sort obvious.
Treat sort, filter, and paging as one view state.
Keep raw source data separate from the displayed view.
Reset or preserve paging intentionally when sort changes.

A table feels professional when users can explain why the current rows appear in the current order.

If users can trigger sorting, the interface should also show what is currently sorted and in which direction. Otherwise the table changes without explanation.

Good signal
Use visible sort affordances so the table state is never implicit.

Keep the original dataset intact and let the displayed layer handle sort order. That makes the page easier to reason about when more than one component depends on the same source.

Safer architecture
One source can feed multiple displays without being mutated for each one.

Pair sorting with filtering and paging consciously

Section titled “Pair sorting with filtering and paging consciously”

Changing sort may affect page position, result order, and which rows remain visible after a filter. Treat those transitions deliberately so users do not lose context.

Whole-view thinking
The table state is one conversation, not three unrelated controls.

Sortable tables naturally lead into text filters, checkbox filters, no-results messaging, and record counts.