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

    ancient-shoe-86801

    07/18/2022, 11:20 PM
    You can use Windows Key + Shift + S to take a screenshot on Windows 😉
  • a

    ancient-shoe-86801

    07/18/2022, 11:23 PM
    @icy-scooter-3369 what browser are you using?
  • g

    green-napkin-82002

    07/18/2022, 11:25 PM
    The Static directory doesn't belong in the templates directory unless that's the way you configured it in your settings
  • i

    icy-scooter-3369

    07/18/2022, 11:32 PM
    Chrome
  • i

    icy-scooter-3369

    07/18/2022, 11:33 PM
    I've configured that way
  • i

    icy-scooter-3369

    07/18/2022, 11:33 PM
    In settings
  • a

    ancient-shoe-86801

    07/18/2022, 11:34 PM
    then open this and check if there are any errors on the console, and see on the Network tab that everything is right.
  • a

    ancient-shoe-86801

    07/18/2022, 11:34 PM
    if you are not familiar with it, I highly recommend getting to know it a bit, as it will be on of your main tools for debugging web apps
  • i

    icy-scooter-3369

    07/18/2022, 11:53 PM
    So, I started a brand new project to try from zero... This photo below is using HTMX from CDN (when typing any character in input field, the character is displayed into a tag)
  • i

    icy-scooter-3369

    07/18/2022, 11:55 PM
    In browser, at developer tool, I can see the GET working for each character I put in input field (hx-trigger="keyup")
  • i

    icy-scooter-3369

    07/18/2022, 11:58 PM
    Now, I commented the CDN line and changed to script tag like the photo below. The js file can be found, but HTMX do not work
  • i

    icy-scooter-3369

    07/19/2022, 12:01 AM
    I'm so sorry, this images are horrible. I'll keep trying to figure it out.. Sorry guys
  • h

    happy-microphone-42295

    07/19/2022, 12:22 AM
    The problem seems to be the path where is htmx.min.js
  • i

    icy-scooter-3369

    07/19/2022, 12:43 AM
    Wish you were right, but the js file can be found by the browser
  • c

    calm-queen-64495

    07/19/2022, 12:49 AM
    Well I think it may be that my ListViews calls the client_card partial and the partial calls clients causing a recursive loop?
  • i

    icy-scooter-3369

    07/19/2022, 12:54 AM
    I got it, guys! Just take the raw content of a brand new 'htmx.min.js' from oficial page and put it into a new file with the same name. Seems like when I downloaded the js file something goes wrong... So instead of download it, I copy it's content to a new file.
  • i

    icy-scooter-3369

    07/19/2022, 12:54 AM
    Now it's working!
  • c

    calm-queen-64495

    07/19/2022, 1:10 AM
    My main issue is Im listing the items trying to use infinite scroll and also trying to filter those results with a text box, if i try and search everything is dumped on the page, because when I search it triggers the below function.
    Copy code
    def get_template_names(self):
            if self.request.htmx:
                return 'partials/client_card.html'
            return 'clients.html'
  • c

    clean-vegetable-65167

    07/21/2022, 4:02 PM
    hi guys, have you ever encountered a problem with browser cache? when I do an action which returns HTMX response (in this case filtering catalog of products, which returns products and updated filters from API) then go to product detail and come back using back button, the request gets served from disk cache. In result the page is empty with no content in head, footer etc. just the HTMX part response displayed - which obviously breaks stuff as the css is missing
  • c

    clean-vegetable-65167

    07/21/2022, 4:05 PM
    is it possible to disable caching mechanism somehow and always issue HX-History-Restore-Request on 'going back'?
  • m

    mysterious-toddler-20573

    07/21/2022, 5:31 PM
    set
    htmx.config.historyCacheSize
    to 0
  • l

    lively-table-42291

    07/22/2022, 9:03 AM
    is there an htmx attribute that disables htmx when the tab is hidden/not focussed? intercoolerjs had these
    Copy code
    ic-disable-when-doc-hidden="true" 
    ic-disable-when-doc-inactive="true"
  • c

    clean-vegetable-65167

    07/22/2022, 11:01 AM
    thank you
  • m

    mysterious-toddler-20573

    07/22/2022, 12:47 PM
    not currently
  • r

    rapid-river-40444

    07/22/2022, 2:12 PM
    Hello guys, is there any implementation of multi-upload images with a preview that you can guide me to? I'm thinking about having one, and I'm wondering if something like that exists. Any hint would be appreciated.
  • c

    calm-queen-64495

    07/24/2022, 2:28 AM
    Im trying to trigger a hx-get from a different drop down using
    Copy code
    hx-trigger="keyup changed from: #service-type"
  • c

    calm-queen-64495

    07/24/2022, 2:28 AM
    But the request is not triggering
  • c

    calm-queen-64495

    07/24/2022, 2:28 AM
    is this correct?
  • c

    calm-queen-64495

    07/24/2022, 3:15 AM
    Looks like there is a problem with using HTMX and Select2
  • c

    calm-queen-64495

    07/24/2022, 4:55 AM
    With hx-include can you include more than one element [name='element', name='element2']?
1...666768...100Latest