powerful-eye-47205
06/08/2022, 10:33 PMhundreds-camera-24900
06/08/2022, 11:23 PMancient-shoe-86801
06/08/2022, 11:28 PMancient-shoe-86801
06/08/2022, 11:42 PMhx-vals="js:{compute_type: document.getElementById('compute-type').value,
cluster: document.getElementById('cluster').value,
plan_type: document.getElementById('plan-type').value}powerful-eye-47205
06/09/2022, 12:41 AMhx-swap-oob attr goes only in my partial that comes back as the response right?hundreds-camera-24900
06/09/2022, 12:44 AMhtml
<div>
content
</div>
<div hx-oob="second-place">
content
</div>hundreds-camera-24900
06/09/2022, 12:44 AMpowerful-eye-47205
06/09/2022, 12:48 AMpowerful-eye-47205
06/09/2022, 12:49 AMmysterious-toddler-20573
06/09/2022, 1:36 PMhx-include to include them alltall-dinner-62086
06/09/2022, 1:37 PMic-include?mysterious-toddler-20573
06/09/2022, 1:37 PMmysterious-toddler-20573
06/09/2022, 1:37 PMtall-dinner-62086
06/09/2022, 1:38 PMmysterious-toddler-20573
06/09/2022, 1:38 PMmysterious-toddler-20573
06/09/2022, 1:38 PMtall-dinner-62086
06/09/2022, 1:39 PMancient-shoe-86801
06/09/2022, 4:51 PMancient-shoe-86801
06/09/2022, 5:02 PMhx-get I could add hx-include=".filter", and then add the filter class to each child select element? I think I'm not getting how hx-include is supposed to work, because that is not including any params to the request.mysterious-toddler-20573
06/09/2022, 5:18 PMmysterious-toddler-20573
06/09/2022, 5:18 PMancient-shoe-86801
06/09/2022, 5:27 PMancient-shoe-86801
06/09/2022, 5:27 PMname attribute to be on the element, as it uses that for the param nameancient-shoe-86801
06/09/2022, 5:29 PMhx-include="select"powerful-eye-47205
06/09/2022, 8:08 PMhx-swap-oob (now that I understand it). I'm working on some Express middleware to put it to use to achieve near-superpowers on the server side.tall-dinner-62086
06/09/2022, 8:11 PMpowerful-eye-47205
06/09/2022, 8:12 PMres.render('/some/path', { vars }) will parse my templates, wrap it in a layout, populate the vars, etc. and then render the full page. But...
res.swap('/some/path', { vars }) will look for an HX-Trigger header and then return only that element by id in the response – I'll use Cheerio or something to grab just that chunk of DOM. And then there's the THIRD optional arg which is a list of additional ids to be swapped (by appending hx-swap-oob nodes to the response)powerful-eye-47205
06/09/2022, 8:13 PMpowerful-eye-47205
06/09/2022, 8:14 PMtall-dinner-62086
06/09/2022, 8:17 PM@htmx() directive that would conditionally render content based on htmx headers. So for example I could request an update to an item on a table, with an oob swap for the "totals" line. It's sort of the opposite approach of trying to only build what I need from my templates, instead of extracting ids from the templates after rendering them.