Closed michapixel closed 1 year ago
thanks for asking
The approach is a little different, here the components are provided as examples with minimal configuration.
the goal is to easily adapt to as many contexts as possible. However it requires a little more work to start, it won't suit everyone.
To summarize, you create your own datatable component
<script lang="ts">
import { DataHandler, Th, ThFilter, RowsPerPage, RowCount } from '@vincjo/datatables'
const handler = new DataHandler(myData, { rowsPerPage: 10 })
const rows = handler.getRows()
</script>
<header>
<RowsPerPage {handler}/>
</header>
<table>
<!-- stuff -->
</table>
<footer>
<RowCount {handler}/>
</footer>
Ah, i should have looked at the src files first, before asking :)
was just looking at the docs and somehow couldn't figure it out ...
I was wrong, it turns out to be very useful to make these components optional. Just updated https://vincjo.fr/datatables/examples/blocks
the predecessor could do that ...