default to 50 rows pagination
This commit is contained in:
parent
89252619b1
commit
dc866dd540
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
|
let tablePageCount = [50, 100, 250, 500];
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import {
|
import {
|
||||||
createSvelteTable,
|
createSvelteTable,
|
||||||
@ -65,6 +66,11 @@
|
|||||||
const options = writable({
|
const options = writable({
|
||||||
data: [],
|
data: [],
|
||||||
columns: columns,
|
columns: columns,
|
||||||
|
initialState: {
|
||||||
|
pagination: {
|
||||||
|
pageSize: tablePageCount[0],
|
||||||
|
},
|
||||||
|
},
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
getFilteredRowModel: getFilteredRowModel(),
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
getPaginationRowModel: getPaginationRowModel(),
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
@ -235,7 +241,7 @@
|
|||||||
$table.setPageSize(Number(e.target.value));
|
$table.setPageSize(Number(e.target.value));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#each [10, 25, 50, 100, 250] as pageSize}
|
{#each tablePageCount as pageSize}
|
||||||
<option value={pageSize}>{pageSize}</option>
|
<option value={pageSize}>{pageSize}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user