cuddly-journalist-16574
06/20/2022, 10:51 PMcuddly-journalist-16574
06/20/2022, 10:55 PMcuddly-journalist-16574
06/20/2022, 11:11 PMcalm-dentist-83819
06/21/2022, 2:25 AM<template id="foo">{{#.}}<li>{{title}} <button data-id="{{id}}">edit</button></li>{{/.}}</template>. Now how do I make the button clickable via htmx (instead of using native JS's onclick event)?worried-hair-75253
06/21/2022, 2:42 AMhx-trigger="click" attribute to the button in the template. https://htmx.org/docs/#triggers Maybe I'm missing something from your question?calm-dentist-83819
06/21/2022, 2:44 AMhx-trigger for AJAX requests only? I'm trying to make the click execute some JS instead.calm-dentist-83819
06/21/2022, 2:49 AMworried-hair-75253
06/21/2022, 2:52 AMhx-trigger would normally kick off an HTMX request to the server. For what you're trying to do, perhaps something like Alpine.js may be more of what you're looking for? FWIW, that's what I use for dealing with element click events in client code and it supports templating natively just like what you're describing...calm-dentist-83819
06/21/2022, 2:56 AMonclick on the button instead of an htmx method. There's htmx.on() but it doesn't bind to new DOM content.worried-hair-75253
06/21/2022, 3:04 AMancient-father-3063
06/21/2022, 7:17 AMancient-father-3063
06/21/2022, 7:17 AMancient-father-3063
06/21/2022, 7:32 AMancient-father-3063
06/21/2022, 7:32 AMancient-father-3063
06/21/2022, 7:32 AM{% render_field league_form.mtgFormat name="leagueformat" class="form-control" hx-trigger="change, load" hx-post="/account/enable" hx-target="#myDeck" %}ancient-father-3063
06/21/2022, 7:32 AMancient-father-3063
06/21/2022, 7:33 AM<select class="form-control" hx-post="/leagues/formatdecks" hx-target="#myDeck" hx-trigger="change, load" id="id_mtgFormat" name="leagueformat" required="">ancient-father-3063
06/21/2022, 7:33 AMancient-father-3063
06/21/2022, 7:33 AMtall-dinner-62086
06/21/2022, 8:33 AMsome-diamond-25050
06/21/2022, 12:23 PMmysterious-toddler-20573
06/21/2022, 1:31 PMhx-trigger="load" and hx-post="/leagues/formdeck" to it to make sure things are plugged in?mysterious-toddler-20573
06/21/2022, 1:32 PMmysterious-toddler-20573
06/21/2022, 1:42 PMbrainy-ice-92385
06/21/2022, 1:46 PMancient-father-3063
06/21/2022, 1:54 PMmysterious-toddler-20573
06/21/2022, 1:54 PMmysterious-toddler-20573
06/21/2022, 1:54 PMmysterious-toddler-20573
06/21/2022, 1:54 PMancient-father-3063
06/21/2022, 1:54 PM