question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataTable does not inherint TableOptions props

See original GitHub issue

As the title says, the DataTable components have not inherited props from TableOptions such as columns, data according to vscode’s typescript IntelliSense. I copied example code from https://www.saas-ui.dev/docs/data-display/data-table#typescript image

I thought it was because of types issues regarding columns, so I removed them but the error still persisted image

Removing columns from DataTable now shows that prop data does not exist image

Type error disappears after removing all props

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
waptikcommented, Mar 25, 2022

It might be possible to do something like this.

<DataTable columns={columns} data={data} plugins={[useFilters, usePagination]}>
  <DataTableBody>
  {({page}) => {
    return page.rows.map((row) => <DataTableRow {...row} />)
   }}
  </TableBody>
</DataTable>

There’s quite some work involved to make this happen, so it won’t make it into the 1.0 release for now. But will add this to the roadmap.

This approach isn’t bad. Well, no biggie. If I find myself in need of extra features and they are not available out of the box, I can just copy the original code and tweak it to suit my needs.

1reaction
Pagebakerscommented, Mar 25, 2022

It might be possible to do something like this.

<DataTable columns={columns} data={data} plugins={[useFilters, usePagination]}>
  <DataTableBody>
  {({page}) => {
    return page.rows.map((row) => <DataTableRow {...row} />)
   }}
  </TableBody>
</DataTable>

There’s quite some work involved to make this happen, so it won’t make it into the 1.0 release for now. But will add this to the roadmap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inherit settings from another datatable? — DataTables forums
Currently there is no why to inherit from an existing DataTable directly - however you could: Set defaults; Use a common initialisation object ......
Read more >
Issue on inheriting from DataTable - Stack Overflow
I am pretty sure the the DataTable Class does not have any virtual methods or properties that you could override, and memeber hiding...
Read more >
Custom stuff while table data is loading · Issue #60 - GitHub
Hello, When the data for the table is loading, users see "Sorry, no matching records found" for a couple seconds while it is...
Read more >
DataTable Class (System.Data) - Microsoft Learn
Gets a value indicating whether the component is currently in design mode. (Inherited from MarshalByValueComponent). DisplayExpression. Gets or sets the ...
Read more >
DataTable code and API | Table - Semrush Developers
Since columns and cells are inherited from the Flex component, you can use justifyContent/alignItems to align the column to the desired edge. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found