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

Transition ITables to the React component of DataTables #335

Open
mwouts opened this issue Nov 18, 2024 · 3 comments
Open

Transition ITables to the React component of DataTables #335

mwouts opened this issue Nov 18, 2024 · 3 comments
Assignees

Comments

@mwouts
Copy link
Owner

mwouts commented Nov 18, 2024

DataTables now has a react component.

Using the react component rather than the current jQuery DataTable function sounds like a natural move, and it should also make it easier to provide a Dash Component for ITables (#245).

@mwouts mwouts self-assigned this Nov 18, 2024
@mwouts
Copy link
Owner Author

mwouts commented Nov 18, 2024

@AllanJard thank you for developing the react component, it looks great! Also as mentioned above I think it should let me unlock the last Python Web App framework that I wanted to support in ITables, so I am very much looking forward to trying it!

May I ask you three quick questions to help me make this transition in a correct way?

  1. Is it correct that the react component won't convert tables that are initially provided in HTML like these pandas style objects ? - I probably still need the usual DataTable function for those?
  2. Can I pass Javascript callbacks like e.g. formatting callbacks through the datatables options ? I see that some options are explicitly supported but I am not sure re the callbacks.
  3. In the app components, e.g. the Jupyter Widget, I had to resort to destroy for the case when the initial options (say e.g. the data + the columns) are modified. Is there a nicer or an alternative way to do this with the react component?

Thank you!

@AllanJard
Copy link

  1. Correct. You cannot have two different libraries controlling the same DOM. They will each make assumptions that might not hold true when the other one changes the DOM. For example DataTables doesn't expect another library to change the tr rows in the table body.
  2. Yes. You can pass callbacks to the options object - it is just a Javascript object.
  3. Not yet. I do plan to "watch" for changes on configuration options - e.g. enable / disable paging and have it automatically destroy and recreate the DataTable, but that is not something that it does yet.

@mwouts
Copy link
Owner Author

mwouts commented Nov 20, 2024

Thank you Allan, that is very helpful! Looking forward to giving it a try!

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