Built‑in DataTables stateSave versus external URL query strings for paging state during Ajax migration
0 reputation · 26 Apr 2025, 16:56 UTC
Goal: Migrate a small web application from a static HTML table to jQuery DataTables sourcing data via Ajax while keeping the user interface available at all times.
During the migration the table’s current paging, sorting and filter state must survive the switch from client‑side to server‑side processing without a full page reload.
Uncertainty: DataTables’ built‑in stateSave option works reliably with client‑side data, but its interaction with serverSide:true and Ajax‑driven updates is inconsistently documented across versions, making it unclear whether the saved state will include paging information after the Ajax URL is changed.
Does enabling stateSave:true with serverSide:true reliably persist paging across page reloads during an incremental Ajax migration? If not, what adjustments via the stateSaveParams callback are required to sync the saved start and length values with server parameters? Is managing UI state externally—for example, by encoding paging and sorting in the URL query string—a simpler alternative that avoids these version‑specific inconsistencies?