bland-coat-6833
04/29/2022, 6:53 PMhx-select I’m assuming you’re getting the full page back from the server. Do you therefore need the select? Can’t you just let boost do its thing for the body? (Just wondering not suggesting you change what’s working.)powerful-eye-47205
04/29/2022, 7:06 PMbland-coat-6833
04/29/2022, 7:12 PMpowerful-eye-47205
04/29/2022, 7:15 PMsquare-analyst-94375
04/29/2022, 9:39 PMbland-coat-6833
04/29/2022, 10:02 PMhx-push-url="true". (https://htmx.org/docs/#history)square-analyst-94375
04/29/2022, 10:20 PMworried-hair-75253
04/29/2022, 11:08 PMdetail parameter from a custom event as payload to the server when either calling htmx.trigger() or sending an HX-Trigger header in the Response of a previous request. If we just focus on client-side for now: in the documentation https://htmx.org/api/#trigger we are sending detail of {answer:42} as the third arg. But I cannot find a way to send that detail up to the server when the hx-trigger="myEvent" is called on id="tab2" element (per the example). Best I can do so far is to use an Alpine method to create an {answer:42} object and then JSON.stringify that object and add it as an hx-vals attribute to the tab2 element prior to calling htmx.trigger('#tab2','myEvent'). That works. But if we're able to send the detail {answer:42} in the event trigger, how do we handle that detail message in the element prior to the get/post being sent to the server?refined-waiter-90422
04/30/2022, 12:06 PMrefined-waiter-90422
04/30/2022, 12:08 PMPHP, JS, HTML, CSS, all vanilla, no frameworks except jQuery on all sites, no exceptions, no template lang, handwritten by merefined-waiter-90422
04/30/2022, 12:17 PMcreamy-scooter-43200
04/30/2022, 12:25 PMcreamy-scooter-43200
04/30/2022, 12:36 PM<form hx-post="." hx-trigger="end">
<ul class="list list-group">
<li class="list-group-item">A
<input type="hidden" name="letter" value="A">
<ul class="list list-group">
<li class="list-group-item list n1"><input type="hidden" name="number" value="1">1</li>
<li class="list-group-item list n1"><input type="hidden" name="number" value="2">2</li>
</ul>
</li>
<li class="list list-group-item">B
<input type="hidden" name="letter" value="B">
<ul class="list-group">
<li class="list-group-item list n1"><input type="hidden" name="number" value="3">3</li>
<li class="list-group-item list n1"><input type="hidden" name="number" value="4">4</li>
</ul>
</li>
</ul>
</form>
<script>
htmx.onLoad(function(content) {
var elements = document.getElementsByClassName('list');
for (var i = 0; i < elements.length; i++) {
new Sortable(elements[i], {
group: 'nested',
animation: 150,
fallbackOnBody: true,
swapThreshold: 0.65
});
}
})
</script>creamy-scooter-43200
04/30/2022, 12:38 PMcreamy-scooter-43200
04/30/2022, 12:39 PMletter: A
letter: B
number: 1
number: 3
number: 2
number: 4many-lizard-89013
04/30/2022, 4:26 PMhx-trigger for the summary to hx-trigger="textUpdate from:body" and the handler for text_update generates a header like this:
rust
HttpResponse::Ok()
.header("HX-Trigger", "textUpdate")
.body(rendered)
but the update isn't getting triggered at all. Any idea what I might be doing wrong? Thank you!refined-waiter-90422
04/30/2022, 4:59 PMmysterious-toddler-20573
04/30/2022, 5:14 PMmany-lizard-89013
04/30/2022, 6:46 PMhundreds-camera-24900
04/30/2022, 7:32 PM<div hx-swap-oob="beforeend:#messages" class="green">
<div> some content </div>
</div>hundreds-camera-24900
04/30/2022, 7:32 PM<div> some content </div>hundreds-camera-24900
04/30/2022, 7:32 PMhundreds-camera-24900
04/30/2022, 7:32 PMhundreds-camera-24900
04/30/2022, 7:32 PMmany-lizard-89013
04/30/2022, 8:21 PMhundreds-jordan-64279
05/01/2022, 7:24 AMhundreds-jordan-64279
05/01/2022, 7:24 AMrefined-waiter-90422
05/01/2022, 9:10 AMhundreds-jordan-64279
05/01/2022, 9:16 AM