Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Dash component for ITables/DataTables #245

Open
mwouts opened this issue Mar 20, 2024 · 3 comments
Open

Implement a Dash component for ITables/DataTables #245

mwouts opened this issue Mar 20, 2024 · 3 comments
Assignees

Comments

@mwouts
Copy link
Owner

mwouts commented Mar 20, 2024

It would be great to be able to use ITables/DataTables in the context of a Dash by Plotly application.

@mwouts mwouts self-assigned this Mar 20, 2024
@mwouts
Copy link
Owner Author

mwouts commented Mar 20, 2024

Hey @AllanJard, I have a prototype for this that kind of works.

One question for you. Usually my tables have complex headers, so I define the table header in HTML. In the context of React, I can do this too, but I have the impression that passing the html header will require a call dangerouslySetInnerHTML like e.g.

const html_table = {__html:html_table_header};
return <div dangerouslySetInnerHTML={html_table}/>;

I would prefer to avoid using dangerouslySetInnerHTML if possible.

I have found this example where the columns are created directly from the code, and I have been able to use that in React. But that example is for a simple header. So my question is: is it possible to create a complex table header using the column argument of DataTable rather than a HTML header? Thanks!

@AllanJard
Copy link

There is no ability using the DataTables API to construct a complex header at this time I'm afraid. It is something I've pondered over, but never come up with an API that I'm happy with, and is of a decently small size to fit in. Can you use standard DOM methods, rather than writing in the plain HTML? That would be safer.

@mwouts
Copy link
Owner Author

mwouts commented Mar 21, 2024

No worries! Thanks for you quick answer!

Well currently I use Pandas' HTML conversion to get the table header, that saves me the burden of having to write it myself. I am not familiar with DOM methods, but maybe in the context of React I could use something like this example, I will keep that in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants