Datatable
Tabulator: sorting, pagination and export, fed from the data service.
How to use it
Copy any example below and paste it in- Marker
data-datatable="resource". The value is a resource name handed to core/data-service.js — the page never fetches.- Columns
- Taken from
meta.columnsin the response if present, otherwise inferred from the first row. - Export
- A button with
data-datatable-for="id"anddata-datatable-export="csv|json". - One trap
- Leave
responsiveLayout: false. Withcollapse, an overflowing column is moved into a panel with no toggle and its data becomes unreachable.
Invoices, with export
Source: invoices.json
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
<p class="text-sm text-muted">Source: <code>invoices.json</code></p>
<div class="flex gap-2">
<button type="button" data-datatable-for="tbl-demo" data-datatable-export="csv" class="btn btn-sm">
<i class="bi bi-filetype-csv"></i> CSV
</button>
<button type="button" data-datatable-for="tbl-demo" data-datatable-export="json" class="btn btn-sm">
<i class="bi bi-filetype-json"></i> JSON
</button>
</div>
</div>
<div id="tbl-demo" data-datatable="invoices" data-datatable-page-size="5"></div>