| {row.first_name} | {row.last_name} | {row.email} |
Showing {start} to {end} of {total} entries
{selected} of {total} row(s) selected
``` -------------------------------- ### Get Selected Rows Source: https://github.com/vincjo/datatables/blob/main/static/documents/markdown/client/methods.getSelectedRows.md Use this method to retrieve the complete row objects for all currently selected rows in the table. No setup or imports are required if you have a table instance. ```typescript table.getSelectedRows() ``` -------------------------------- ### Create Search and Filter Instances Source: https://github.com/vincjo/datatables/blob/main/src/routes/docs/client/getting-started/migration/content.svx Demonstrates how to create search and column filter instances using the TableHandler API. ```ts const search = table.createSearch() const filter = table.createFilter('first_name') // column filter ``` -------------------------------- ### Basic Svelte Datatable Implementation Source: https://github.com/vincjo/datatables/blob/main/README.md Initialize a TableHandler with data and display it in a Svelte table. Configure rows per page during initialization. ```svelte| First name | Last name |
|---|---|
| {row.first_name} | {row.last_name} |
Showing {start} to {end} of {total} rows
``` -------------------------------- ### setPage Method Source: https://github.com/vincjo/datatables/blob/main/static/documents/markdown/methods.setPage.md The setPage method allows users to navigate to a specific page, the previous or next page, or the last page of the table. It accepts a page number (integer) or a string representing the desired navigation action. ```APIDOC ## setPage Method ### Description Navigates the table to a specified page. ### Method Signature `setPage(page: number | 'previous' | 'next' | 'last'): void` ### Parameters - **page** (number | 'previous' | 'next' | 'last') - Required - The target page to navigate to. Can be a specific page number (e.g., 5), or a string indicating relative or boundary navigation ('previous', 'next', 'last'). ### Usage Examples ```ts table.setPage(5) // Navigates to page 5. table.setPage('previous') // Navigates to the previous page. table.setPage('next') // Navigates to the next page. table.setPage('last') // Navigates to the last page. ``` ``` -------------------------------- ### Create Sort Instance Source: https://github.com/vincjo/datatables/blob/main/src/routes/docs/server/sort/button/content.svx Instantiate a sort object for a specific column named 'name'. This object will manage sorting state and actions. ```typescript const sort = table.createSort('name') ``` -------------------------------- ### Import Check Utility Source: https://github.com/vincjo/datatables/blob/main/src/routes/docs/client/filters/check/content2.svx Import the `check` function from the @vincjo/datatables library to utilize its filtering capabilities. ```typescript import { check } from '@vincjo/datatables' ``` -------------------------------- ### Displaying a Loading Spinner with isLoading State Source: https://github.com/vincjo/datatables/blob/main/src/routes/docs/server/data/is-loading/content.svx Use the `isLoading` state property to conditionally show a loading spinner. The spinner is displayed when `table.isLoading` is true. ```svelte| {row.id} | {row.name} | {row.email} | {row.body.substring(0, 60) + '...'} |
| {row.first_name} | {row.last_name} | {row.email} |