https://htmx.org logo
Join Discord
Powered by
# 🔥-django-htmx
  • p

    powerful-eye-47205

    04/12/2022, 11:15 PM
    Yes, sensei!
  • h

    hundreds-camera-24900

    04/12/2022, 11:15 PM
    the big restful aha is that the application is totally seperate from the http/backend
  • h

    hundreds-camera-24900

    04/12/2022, 11:15 PM
    and that's (imho) not htmx-y at all, where the backend is the application
  • p

    powerful-eye-47205

    04/12/2022, 11:17 PM
    Writing routes in Express that are literally like 3 lines of code including a Mongoose query, then rendering in nearly-pure HTML (handlebars) is just astonishingly easy compared to the insane mountain of code that used to require. Thanks for your help.
  • h

    hundreds-camera-24900

    04/12/2022, 11:21 PM
    🙂
  • m

    modern-doctor-63477

    04/26/2022, 3:22 AM
    I'm using hx-swap="outerHTML" to update and replace a entity in an SVG. It is working well except that the position is supposed to be produced by a transform. As it leaves the view, the value of 'form.instance.presentation' is 'matrix(1,0,0,1,350,200)' (this is the same as 'translate(350,200)' - via Django 'print(form).') After htmx has swapped it in, the value of transform is "", and in Chrome it just says .
  • m

    modern-doctor-63477

    04/26/2022, 3:24 AM
    I pass the presentation attributes (currently just a matrix) from an input field that is updated when a drag concludes. Is there a way to POST html / svg attribute values?
  • s

    salmon-oil-67352

    04/26/2022, 7:05 AM
    Hi guys, could someone send me the meme image of the timeline (first basic website, then complicated JS frameworks, then easy HTMX website)? I cant seem to find it
  • m

    magnificent-whale-12111

    04/26/2022, 2:22 PM
    Has anyone had issues with multi-part forms not working? I have a problem that Django and HTMx are not letting the upload portion happen.
  • h

    hundreds-camera-24900

    04/26/2022, 2:33 PM
    like uploading a file?
  • m

    magnificent-whale-12111

    04/26/2022, 3:57 PM
    Yes, exactly
  • m

    magnificent-whale-12111

    04/26/2022, 4:00 PM
    I switched to vanilla HTML and I have no problems.
  • h

    hundreds-camera-24900

    04/26/2022, 4:52 PM
    are you using hx-encoding?
  • h

    hundreds-camera-24900

    04/26/2022, 4:53 PM
    https://htmx.org/examples/file-upload/
  • m

    magnificent-whale-12111

    04/26/2022, 9:32 PM
    Jeeeeeeez I am just plain stupified that I missed that
  • h

    hundreds-camera-24900

    04/26/2022, 10:15 PM
    🙂
  • h

    hundreds-camera-24900

    04/26/2022, 10:15 PM
    imho doc reading is a skill and unfortunately every tool has different docs so you start over all the time
  • m

    mysterious-toddler-20573

    04/26/2022, 10:47 PM
    the only thing worse than a million standards is one standard, when that standard is javadoc
  • h

    hundreds-camera-24900

    04/27/2022, 1:55 AM
    you just have to make a HtmxBeanDocFactoryFactory
  • m

    modern-doctor-63477

    04/27/2022, 7:51 AM
    Well, I ironed out a lot of problems of my own creation, but I'm still stuck - I've got a hx-afterSettle event listener to add event listeners to newly updated elements. When the whole page loads, the elements with a transform attribute are grabbable (can be stored in a js variable - e.g. temp1.transform ) and the elements render correctly. But, the elements received one at a time via htmx after an update is triggered don't work. There's no observable difference in the HTML/SVG but the browser treats them very differently. its the same database and template generating them, but the transform is not applied, and nor are the height and width, and then the transform isn't accessible as a property (e.g. temp1.transform returns null). I feel like there must be some foundational DOM knowledge that I've missed out on.
  • m

    modern-doctor-63477

    04/27/2022, 11:22 PM
    'Solved' this without learning anything by changing to hx-swap="none"
    • 1
    • 4
  • s

    swift-arm-37963

    04/28/2022, 3:55 PM
    Hi! So I'm using bootstrap 5's offcanvas with a CreateView form inside. I have hx-boost enabled in the tag. Now, when there's an error in the information in the form, I would like the offcanvas to remain opened. The bootstrap doc say that in order to show offcanvas on load, just add the
    show
    class. I add it when
    {% if form.errors %}
    = True but the dismissable hooks for the offcanvas do not latch (I can't close it by clicking outside offcanvas nor by clicking the X in the top right). https://getbootstrap.com/docs/5.0/components/offcanvas/ I removed
    hx-boost=True
    in the tag and it works as intended but is there anyway to make it work with hx-boost? I know about
    htmx.process
    but that's only for htmx scripts. Thanks in advance!
  • h

    hundreds-camera-24900

    04/28/2022, 5:56 PM
    Boosting acts like turbolinks so your best bet is to look for similar situations w/ boostrap and turbolinks
  • h

    hundreds-camera-24900

    04/28/2022, 5:56 PM
    that's what it sounds like to me
  • h

    hundreds-camera-24900

    04/28/2022, 5:56 PM
    you could also just replace the form content
  • h

    hundreds-camera-24900

    04/28/2022, 5:56 PM
    vs reloading the page on error
  • s

    swift-arm-37963

    04/28/2022, 10:26 PM
    updates: I loaded it via hyperscript. All good now!
    Copy code
    <div
        class="offcanvas offcanvas-end"
        data-bs-backdrop="false"
        tabindex="-1"
        id="invite"
        aria-labelledby="inviteLabel"
        _="on load
            make a bootstrap.Offcanvas from me called offcanvas
            {% if form.errors %}
                call offcanvas.show()
            {% endif %}
        "
    >
  • h

    hundreds-camera-24900

    04/28/2022, 11:19 PM
    whoah
  • h

    hundreds-camera-24900

    04/28/2022, 11:19 PM
    I never thought of using hyperscript that way
  • h

    hundreds-camera-24900

    04/28/2022, 11:19 PM
    sick
1...575859...100Latest