Datatable - JS-integration problems #2172
-
Hello, const asyncTable = new te.Datatable(
document.getElementById('datatable'),
{ columns, },
{ loading: true }
); results in Can someone help me? What am I missing? Edit: Without changing anything I sometimes also get either this: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hello! I cannot reproduce those errors on my vanilla JS app with vite. Does the issue occur with the code from our Async Data example or is it your own code? https://tw-elements.com/docs/standard/data/datatables/#async-data What stack are you using? Have you tried to use |
Beta Was this translation helpful? Give feedback.
tl;dr: The
tw-elements.umd.min.js
script-tag needs to be of typetext/javascript
, but additional scripts need to be of typemodule
. This wayte
(and all the TWE features) is available, when the additional script runs.Hi @iprzybysz,
thank you for your response. It put me on the right track.
As @juujisai proposed earlier the
type
-attribute was the problem. However, in my case I needed my js code (the code in thehome.html
file) to be of typemodule
- not the Tailwind-JS file.Thank you all for your help!