Streaming content, append table row #716
tuxcanfly
started this conversation in
4. General
Replies: 1 comment 1 reply
-
One thing that stands out is that pen is using Alpine 1.9.8 which is quite old already. Update the script to: https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js Also, you need to call your setInterval function inside of x-init for the component to update <tbody x-data="handler()" x-init="setInterval(() => {
rows.push({
id: rows.length + 1,
msg: 'hello world',
timestamp: '20 Aug 2020'
})
}, 1000)"> |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I need to dynamically append a row to a table:
https://codepen.io/tuxcanfly/pen/XWdjEyd
I tried x-model="rows" but it didn't work. Any idea how I can do this?
See the Pen alpine.js streaming table by Javed (@tuxcanfly) on CodePen.
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>Beta Was this translation helpful? Give feedback.
All reactions