-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add example for DataTables #284
Comments
Might have found a workaround, though not sure if it's correct. Define a
Then, to use it, add this bit to the page:
Note the script type of |
Hey @nderwin, Any reason to create the table from the html instead of from the script as described in the datatable doc: Using: import DataTable from 'datatables.net-dt';
let table = new DataTable('#myTable'); Regarding If you want to access the module from the html page, since we are using modules, they are isolated one from the other, this is why you had to pass your item through the window which is fine IMO, but better do it directly in the js if it's not expressly needed. For future web-bundler, I might add the provided script as an import map so that it will be easier to access exported stuff from it (instead of using window). I need to investigate if that works correctly. |
@ia3andy I have it creating the table in the HTML where the |
That https://docs.quarkiverse.io/quarkus-web-bundler/dev/advanced-guides.html#qute-components might be a good way to deal with it. Where is the data coming from? |
Right now, the data is just rendered in the page with Qute; for other instances, I will probably need to use a server side endpoint to fetch pages of data. |
Ok, I think you should do it all from the I am not sure if the datatable api allows to use a class to bind the table, if it doesn't, just iterate on the class elements. |
I believe it binds to an BTW, here's a reproducer showing how I have it currently working: I'll take a look at the components link to see if that works better. Feel free to close this if there are no actionable changes to make, and thanks for this extension, it is fantastic. |
It would be great if there was an example of how to integrate DataTables with the bundler. So far, my attempts have not been successful.
Adding
to the pom, then trying to create a new DataTable in my Qute template:
gives me a console error that
DataTable
is not defined. I also havein my config, and it's generating a
main.js
file with this line in itso not sure why it's not working. By comparison, Bootstrap, HTMX work perfectly without any additional configuration.
The text was updated successfully, but these errors were encountered: