Stale rows displayed after Ajax data update with stateSave enabled
0 reputation · 15 Jul 2026, 19:01 UTC
Goal: prevent the table from showing rows that no longer match the saved filter or page index after an Ajax data update while stateSave is enabled.
When stateSave restores pagination, search, and column order before the table draws, a subsequent Ajax reload can replace the underlying data set. If the saved state refers to indices or values that are no longer present, the plugin may display stale rows, creating a mismatch between UI state and actual data.
The unresolved decision is whether DataTables should automatically invalidate saved state when the Ajax data source signals a change, or leave this responsibility to developers via custom callbacks.
Should DataTables automatically clear saved state when the Ajax data source signals a change? If not, what is the recommended pattern for developers to detect and handle stale state? Are there any existing callbacks or events that can be relied upon to trigger state invalidation safely?