https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • g

    green-flower-49070

    08/04/2022, 4:05 PM
    @helpful-summer-17915 I use datatables in conjunction with HTMX
  • h

    helpful-summer-17915

    08/04/2022, 4:08 PM
    Ok maybe I try same approach
  • g

    green-flower-49070

    08/04/2022, 4:10 PM
    I don't know what you're trying to do specifically, but I use inline editing with datables
  • g

    green-flower-49070

    08/04/2022, 4:11 PM
    htmx to handle the editing part
  • m

    mysterious-toddler-20573

    08/04/2022, 4:36 PM
    How do people feel about essays being a top level?
  • b

    brainy-ice-92385

    08/04/2022, 5:28 PM
    I think it might be worthwhile to write a paragraph or two on the front page/top of docs, extensively linking to relevant essays, about the justification for the philosophy
  • m

    mysterious-toddler-20573

    08/04/2022, 5:29 PM
    mmm, interesting
  • m

    mysterious-toddler-20573

    08/04/2022, 5:29 PM
    a "philosophy" section
  • h

    hundreds-camera-24900

    08/04/2022, 6:14 PM
    "write your code only according to that maxim whereby you can, at the same time, will that it should become a universal law."
  • p

    proud-guitar-95305

    08/04/2022, 6:20 PM
    Is there something already out there to help me build something similar to compostable components out of htmx functionality?
  • m

    mysterious-toddler-20573

    08/04/2022, 6:35 PM
    kantian ethics in programming is a tragically underexplored topic
  • m

    modern-smartphone-82132

    08/04/2022, 6:37 PM
    How can I kick of a hx-get from within a hyperscript script? Is it possible? I'm collecting values from several different dropdown lists and need to pass them back to the server, hence the hyperscript script.
  • m

    mysterious-toddler-20573

    08/04/2022, 6:40 PM
    send an event and use hx-trigger to listen for it
  • m

    mysterious-toddler-20573

    08/04/2022, 6:40 PM
    Copy code
    html
      <div id="div-1" hx-get="/whatever" hx-trigger="doItNow">
        ...
      </div>
      <button _="on click send doItNow to #div-1">Do It Now</button>
  • b

    brainy-ice-92385

    08/04/2022, 7:12 PM
    What are compostable components? When I google just that I get... compost
  • b

    brainy-ice-92385

    08/04/2022, 7:15 PM
    If you typo'd and meant "composable", then yes: Any HTML templating engine. The best choice for that depends on your stack and your preferences
  • b

    blue-ghost-19146

    08/04/2022, 7:46 PM
    Home-compostable components - they’re software development’s latest contribution to combatting climate change. You haven’t heard?!
  • l

    loud-xylophone-8855

    08/04/2022, 8:50 PM
    Has anyone had any joy getting a confirm dialog up and running UIKit? Can get a standard confirm up and running nice and easy with the system dialog, and there’s the great example using sweetalert - but to avoid adding another library I’ve been trying to use uikits UIkit.modal.confirm('UIkit confirm!'). Trouble is that UIKit uses promises UIkit.modal.confirm('UIkit confirm!').then(function() { console.log('Confirmed.') }, function () { console.log('Rejected.') }); and I can’t get that to work as per the sweetalert example. Probably my lack of understanding of JavaScript promises - then I suppose that’s exactly what htmx is here for 🙂 cheers all!
  • m

    mysterious-toddler-20573

    08/04/2022, 9:07 PM
    You wnat to trigger a custom event on the confirm callback and then have hx-trigger on that custom event.
  • m

    mysterious-toddler-20573

    08/04/2022, 9:07 PM
    lemme see if I can get an example together
  • p

    proud-guitar-95305

    08/04/2022, 9:08 PM
    Ah, yes, I meant composable. I was on my phone and didn't check my spelling. My tech stack is python, so I guess you are suggesting I make snippets of Jinja templates and compose those at the server level?
  • m

    mysterious-toddler-20573

    08/04/2022, 9:13 PM
    https://codepen.io/1cg/pen/OJvvYmd?editors=1000
  • m

    mysterious-toddler-20573

    08/04/2022, 9:13 PM
    Copy code
    html
    <button id="the-btn" hx-get="/foo" hx-trigger="confirm" 
            onclick="UIkit.modal.confirm('UIkit confirm!').then(function() {htmx.trigger('#the-btn','confirm')});">
      Get Foo
    </button>
  • m

    mysterious-toddler-20573

    08/04/2022, 9:14 PM
    kinda ugly, but that's javascript for you
  • l

    loud-xylophone-8855

    08/04/2022, 9:14 PM
    That’s the next thing I was going to try in the morning - but that was introducing vanilla JavaScript - if you could get an example that would be fantastic. It’s a new project for a client and I’m trying my best to keep it JavaScript free unlike my normal projects with vanilla everywhere!
  • m

    mysterious-toddler-20573

    08/04/2022, 9:15 PM
    When I'm emperor dictator for life all js libraries will be required to fire events
  • l

    loud-xylophone-8855

    08/04/2022, 9:20 PM
    Fantastic. Will give that a go in the morning - late now. I’d tried similar with hyperscript and it didn’t seem to like the promises in the “call”. And hadn’t spotted htmx.trigger existed! I am converted to htmx - normally I steer clear of “black box” libraries but this is working so neatly with VB asp.net.
  • m

    mysterious-toddler-20573

    08/04/2022, 9:21 PM
    yeah, that promise doesn't return a value, it's a bad API
  • m

    mysterious-toddler-20573

    08/04/2022, 9:22 PM
    it should return a value and only call the "throw" callback when there's a real error, but here we are, programming in javascript
  • m

    mysterious-toddler-20573

    08/04/2022, 9:22 PM
    we get what we deserve
1...769770771...1146Latest