Skip to content

Commit

Permalink
Merge pull request #193 from lolcabanon/docs/add-warning-column-id
Browse files Browse the repository at this point in the history
Update `createColumns()` doc
  • Loading branch information
bryanmylee committed Feb 22, 2024
2 parents 0bad95b + 77936b3 commit 08dd201
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/routes/docs/[...2]api/[...3]create-columns/+page.md
Expand Up @@ -81,6 +81,12 @@ const columns = table.createColumns([

#### `columnDef.id?: string`

:::admonition type="warning"

The `id` will be parsed with [`svelte-keyed`](https://github.com/bryanmylee/svelte-keyed), so make sure to format it without dot notation (`object.prop`) or array notation (`object[0]`).

:::

Defines the id of the data column. **Duplicate ids are not allowed** on a single table.

_Defaults to the value of `accessor` if a string accessor is passed. If a function accessor is passed, defaults to the value of `header` instead_.
Expand Down

0 comments on commit 08dd201

Please sign in to comment.