Relative Content

Tag Archive for djangohtmx

Why isn’t my nav updating after htmx trigger?

I have a django project with a left navbar list of projects. I am new to htmx and I’m using it to update the project list after a new project is created from a form. I can see the htmx trigger event and the payload looks correct and the target div element looks correct. However, the update doesn’t occur. I’ve tried including from:body. I have a hx-target in the form and I generate the HX-Trigger in the view, but I’m not sure if that’s correct.

Can’t get two elements to update while using Django and HTMX

I’m trying to create a car pool where I use HTMX in my Django project to make it work. The CarPool model consist of two FK. One FK is “City”, and the other is “Car”. I have it somewhat working. So within my two tables (one table with all the cars that have no city attached, and the other table displaying all the cars attached to the city that has been clicked), I’m able to use hx-post to add the car, and same to remove the car with the clicked city. But I don’t get the lists to update after they are clicked.