Skip to main content

data

Description

Optional. An array of objects with data for the Grid

Usage

data?: [];

Parameters

The set of parameters is arbitrary in the data array but the column ID if used should be unique.

Example

<script>
import { Grid } from "@wx/svelte-grid";
import { getData } from "./common/data";

const { columns } = getData();

const data = [
{
id: 1,
city: "Amieshire",
country: 6,
email: "Leora13@yahoo.com",
firstName: "Ernest",
lastName: "Schuppe",
street: "Ratke Port",
zipCode: "17026-3154",
date: new Date("2016-09-23T07:57:40.195Z"),
companyName: "Lebsack - Nicolas",
stars: 820,
followers: 70,
newsletter: true,
checked: 1,
},
{
id: 2,
city: "Gust",
country: 4,
email: "Mose_Gerhold51@yahoo.com",
firstName: "Janis",
lastName: "Vandervort",
street: "Dickinson Keys",
zipCode: "43767",
date: new Date("2017-03-06T09:59:12.551Z"),
companyName: "Glover - Hermiston",
stars: 1200,
followers: 170,
checked: 1,
},
];

</script>

<Grid {data} {columns} />