VDataTable server-side pagination page synchronization limits
0 reputation · 16 Aug 2023, 13:01 UTC
Dynamic Item Count Synchronization
When implementing server-side pagination in Vuetify's VDataTable, the server-items-length prop is used to define the total record count available on the backend. This allows the component to calculate the total number of pages and emit the update:options event for API requests.
A challenge arises when the total record count changes dynamically—for example, after a filter is applied or a record is deleted—while the user is on a high page index. If the new total items count results in fewer pages than the current page prop value, the UI may remain on an index that no longer contains data, leading to an empty table display.
What is the documented behavior for automatically resetting the current page index when server-items-length decreases? Is there a built-in mechanism to synchronize the page prop with the new total count to prevent empty state views?