echoing-book-71490
06/23/2022, 11:56 AMtall-dinner-62086
06/23/2022, 11:58 AMitems[12345][qty] is what I do for my own forms when I want to submit a list of things. But it does require server-side knowledge that the id is the array key.tall-dinner-62086
06/23/2022, 11:59 AMid and not, say the product_codeechoing-book-71490
06/23/2022, 12:00 PMechoing-book-71490
06/23/2022, 12:01 PMitems[][qty] would introduce ambiguity. Maybe it should just be items[0][qty], items[1][qty], ... instead and hidden items[0][id] fields, thinking about ittall-dinner-62086
06/23/2022, 12:02 PMtall-dinner-62086
06/23/2022, 12:02 PMechoing-book-71490
06/23/2022, 12:02 PMechoing-book-71490
06/23/2022, 12:02 PMitems[index][field]tall-dinner-62086
06/23/2022, 12:03 PMechoing-book-71490
06/23/2022, 12:03 PMlittle-journalist-53964
06/23/2022, 5:09 PMevery 5s trigger. What I need to implement is: the second a user starts dragging, the parent element will not get swapped. Once they release the drag, normally swapping behavior should resume. How can I do this?little-journalist-53964
06/23/2022, 5:17 PMhtmx:beforeSwap and cancel it while the drag is activebrainy-ice-92385
06/23/2022, 6:34 PMlittle-journalist-53964
06/23/2022, 6:45 PMflaky-plumber-59703
06/23/2022, 9:40 PMadamant-state-54102
06/23/2022, 11:15 PMhappy-pillow-29003
06/24/2022, 7:09 AMiframe element. It seems you can’t do iframe.innerHTML and you need to do something like iframe.contentWindow.document.innerHTML. I thought I could achieve this with something like
document.addEventListener("htmx:beforeSwap", (event) => {
if (event.detail.target.nodeName === "IFRAME") {
event.detail.target = event.detail.target.contentWindow.document;
}
});
But I’m getting weird errors from htmx TypeError: f2.classList is undefined. Has anyone ever managed to get swapping working in an iframe element?narrow-chef-14221
06/24/2022, 3:19 PM<div hx-get="/updates" hx-trigger="every 2s">. if I want the polling to stop after 2 minutes or after polling some specific number of times, is there any modification I can do to the trigger to do that? How would you suggest I do it?mysterious-toddler-20573
06/24/2022, 4:01 PMmysterious-toddler-20573
06/24/2022, 4:03 PM<div hx-trigger="every 2s[whileStillPolling()]" ...>
...
<div>
<script>
function whileStillPolling() {
return started > currentTime - someInterval;
}
</script>mysterious-toddler-20573
06/24/2022, 4:04 PMhtmx.trigger())tall-dinner-62086
06/24/2022, 4:22 PMhx-post? I have a mass edit form and I want the user to be able to save changes to just one itemmysterious-toddler-20573
06/24/2022, 4:23 PMmysterious-toddler-20573
06/24/2022, 4:23 PMtall-dinner-62086
06/24/2022, 4:23 PMtall-dinner-62086
06/24/2022, 4:23 PMmysterious-toddler-20573
06/24/2022, 4:24 PMhtmx:configRequest?tall-dinner-62086
06/24/2022, 4:24 PMmysterious-toddler-20573
06/24/2022, 4:24 PM