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
In a simple Data Table, when having pagination and sort enabled the the props object is missing the sort property, hence a condition to check for the sort property with the aim to show ArrowUp or ArrowDowm icons does not work.
The text was updated successfully, but these errors were encountered:
robots4life
changed the title
Data Table - a combination of Pagination and Sort remove sort property from props object
Data Table - a combination of Pagination and Sort removes the sort property from the props object
Jul 24, 2024
// pageCount and pageSize must be included even though they are not used// only if pageCount and pageSize are included will sort work correctlyconst{ hasNextPage, hasPreviousPage, pageIndex, pageCount, pageSize }=pluginStates.page;
Ideally when introducing pagination to the Date Table in the docs this could be pointed out.
In the next step we are going to add sorting to the data table, for pagination and sorting to work correctly you will have to modify pluginStates.page, more about this in the next step.
If you like to use sorting with an icon on condition of the sort order and you have pagination in place you will need to add pageCount and pageSize to pluginStates.page.
Describe the bug
In a simple Data Table, when having pagination and sort enabled the the
props
object is missing thesort
property, hence a condition to check for thesort
property with the aim to showArrowUp
orArrowDowm
icons does not work.Not using Shadcn-Svelte does not have the issue as can been see in this REPL.
https://svelte.dev/repl/9b98604e674b482fa50ed1b8ab5fd1e2?version=4.2.18
Reproduction
https://github.com/robots4life/shadcn-svelte-data-table/tree/main
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: