Comments (4)
I found solution. I need to check if row.isData() before being able to access original.
from svelte-headless-table.
@NiklasKK Did you try doing the check inline? I did it like so:
href={row.isData() ? `/${row.original.event_id}`: "#"}
from svelte-headless-table.
@NiklasKK Did you try doing the check inline? I did it like so:
href={row.isData() ? `/${row.original.event_id}`: "#"}
Okay, yeah when I change it to inline the error disappears. Guess it's more an error of Svelte then.
from svelte-headless-table.
I tried the check with if but it does not work for me any ideas what I'm doing wrong here?
It still gives me the error:
Property 'original' does not exist on type 'BodyRow<LdapMember, { sort: TablePlugin<any, SortByState<any>, SortByColumnOptions, SortByPropSet>; }>'.ts(2339)
<tbody {...$tableBodyAttrs}>
{#each $rows as row (row.id)}
<Subscribe rowAttrs={row.attrs()} let:rowAttrs>
<tr {...rowAttrs} class="text-start">
<!-- isData() check here -->
{#if row.isData()}
<td class="p-0 m-0">
<button
type="button"
class="btn btn-sm btn-success w-auto"
on:click={() => addMember(row.original)}>Add</button
></td>
{/if}
{#each row.cells as cell (cell.id)}
<Subscribe attrs={cell.attrs()} let:attrs>
<td {...attrs}>
<Render of={cell.render()} />
</td>
</Subscribe>
{/each}
</tr>
</Subscribe>
{/each}
</tbody>
from svelte-headless-table.
Related Issues (20)
- Typescript setup without sveltekit HOT 3
- Svelte Headless Table uses stores for reactivity. You need to update that store whenever the page data changes to inform Svelte Headless Table of the data change. HOT 2
- [FR]: Support nested object in initialSortKeys
- Could not find a declaration file for module 'sveltekit-headless-table' HOT 9
- Hiding 'Email' Column removes all rows
- Allow
- Feature request: Allow "shift + click" to select a span of rows
- "Tags filtering" functionality
- addSelectedRows body props do not update with selected state HOT 5
- Table filter for columns containing several filterable items
- Svelte 5 Support HOT 2
- FR: passing class to individual header or columns
- `addDataExport` generates invalid CSV when cells contain commas HOT 2
- Sveltekit | "moduleResolution": "Bundler" | Could not find a declaration file for module 'svelte-headless-table' HOT 8
- Add missing `exports` condition HOT 2
- addGridLayout isn't compatible with addHiddenColumns : hidden columns are not taken into account when calculating the number of columns HOT 7
- Missing modules in 0.18.0 HOT 8
- Cannot find module 'svelte-headless-table/plugins' or its corresponding type declarations on version 0.18.1 HOT 6
- Sveltekit | "moduleResolution": "Bundler" | Cannot find module 'svelte-headless-table/dist/plugins' or its corresponding type declarations. HOT 3
- createRender onClick not updating with new data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-headless-table.