Using AlpineJS with table libraries that manipulate the DOM? #4037
Closed
bmarsh9
started this conversation in
4. General
Replies: 1 comment 2 replies
-
You shouldn't be using jquery anymore. But yes, datatables in generally will want to manipulate the dom, and Alpine won't be aware of things. Ideally the library is sensible and would allow you to pass data from Alpine to the datatables library, and it can pass data back. Having both not communicating data, but both manipulating the dom is a recipe for disaster... |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using DataTables (https://datatables.net/) to add sorting, paging, filtering, etc to my existing tables. I've now started to use AlpineJS to render the table inside a
<template></template>
tags. However I've now run into issues where Datatables will remove elements defined by AlpineJS when initializing and reloading. Here is the code Im working with. Im able to initialize the table however Datatables will immediately remove the<template>
and now I've lost Alpines ability to update the table. I realize this is also a Datatables issue, but they recommended that Datatables should be the only one controlling the DOM. Any help would be appreciated.Beta Was this translation helpful? Give feedback.
All reactions