default to 50 rows pagination

This commit is contained in:
2023-04-12 15:58:13 +02:00
parent 89252619b1
commit dc866dd540

View File

@@ -1,5 +1,6 @@
<script>
import { _ } from "svelte-i18n";
let tablePageCount = [50, 100, 250, 500];
import { writable } from "svelte/store";
import {
createSvelteTable,
@@ -65,6 +66,11 @@
const options = writable({
data: [],
columns: columns,
initialState: {
pagination: {
pageSize: tablePageCount[0],
},
},
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
@@ -235,7 +241,7 @@
$table.setPageSize(Number(e.target.value));
}}
>
{#each [10, 25, 50, 100, 250] as pageSize}
{#each tablePageCount as pageSize}
<option value={pageSize}>{pageSize}</option>
{/each}
</select>