DataTable

ref #5
This commit is contained in:
2020-12-23 20:13:08 +01:00
parent 4765faeddc
commit d2938591bf
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
<script>
import { Grid } from "gridjs";
import "gridjs/dist/theme/mermaid.css";
import { nanoid } from "nanoid";
//
const uniq = nanoid();
const datatable = new Grid({
columns: ["Name", "Email", "Phone Number"],
sort: true,
search: { enabled: true },
data: [
["John", "john@example.com", "(353) 01 222 3333"],
["Mark", "mark@gmail.com", "(01) 22 888 4444"],
["Eoin", "eoin@gmail.com", "0097 22 654 00033"],
["Sarah", "sarahcdd@gmail.com", "+322 876 1233"],
["Afshin", "afshin@mail.com", "(353) 22 87 8356"],
],
pagination: {
enabled: true,
limit: 2,
summary: false,
},
});
setTimeout(() => {
datatable.render(document.getElementById("wrapper" + uniq));
}, 0);
</script>
<div id="wrapper{uniq}" />