filmov
tv
Django and HTMX #17 - Updating Other Content - Out-Of-Band Swaps and Custom Events
Показать описание
In this video, learn how to update non-target elements using two different HTMX mechanisms:
1. Out-of-band swaps: with the hx-swap-oob attribute, you can replace non-target elements in your responses.
2. Triggering client events: your responses to HTMX requests can contain an HX-Trigger HTTP header, which can trigger a client-side event that performs subsequent actions to update the UI. We'll see how to use a tool from the django-htmx package to achieve this.
▶️ Full Playlist:
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:06 Setup
01:57 Creating Event model
03:59 Registering model with admin
06:49 Improving event template
08:10 Subscribing to event with HTMX
09:00 Updating with hx-swap-oob
14:40 Unsubscribing to event with HTMX
20:53 Updating user count
21:49 Triggering custom events
24:34 django-htmx trigger_client_event function
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
#django #htmx #python
1. Out-of-band swaps: with the hx-swap-oob attribute, you can replace non-target elements in your responses.
2. Triggering client events: your responses to HTMX requests can contain an HX-Trigger HTTP header, which can trigger a client-side event that performs subsequent actions to update the UI. We'll see how to use a tool from the django-htmx package to achieve this.
▶️ Full Playlist:
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:06 Setup
01:57 Creating Event model
03:59 Registering model with admin
06:49 Improving event template
08:10 Subscribing to event with HTMX
09:00 Updating with hx-swap-oob
14:40 Unsubscribing to event with HTMX
20:53 Updating user count
21:49 Triggering custom events
24:34 django-htmx trigger_client_event function
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
#django #htmx #python
Django and HTMX #17 - Updating Other Content - Out-Of-Band Swaps and Custom Events
Django & HTMX - Dynamic Form Creation and Submission
Dynamic list views with Django and htmx
django-crispy-forms and HTMX integration #3 - Field validation and the hx-swap-oob attribute
Django Ecommerce Website | Stripe Checkout | Htmx and Tailwind | Part 17
Django & HTMX - django-template-partials for Template Partial Responses
django-htmx - Django Extensions for Working with HTMX
Django, HTMX and DaisyUI Components - Building a To-Do List App
Django & HTMX App - Display Transactions | django-filter FilterSet
Django & HTMX - Template Fragments with django-render-block
Django and HTMX #8 - Infinite Scroll and the hx-push-url attribute
HTMX, AlpineJS and Django Messages - Adding Toast / Alert messages in HTMX Responses
Django and HTMX #16 - Click to Edit pattern
Django and HTMX #7 - File Uploads and Film Detail page
Hyperscript and HTMX - Form Examples with Django
Django and Htmx Todo Application | Tailwind CSS
Django Starter with Allauth and Htmx
Building a Django Web App with HTMX & LLM
Django and HTMX #10 - Chained Dropdowns with Django and HTMX
django-crispy-forms and HTMX integration #2 - User Registration and Login/Logout
Django and HTMX #3 - Listing and Creating Items (with no refresh!)
Django & HTMX App - HTMX form submission | Query Optimization with django-debug-toolbar
Build a Content Engine with Django, Kubernetes, TailwindCSS, Twingate, AWS S3, & HTMX FULL TUTO...
Django HTMX & Alpine.js mini-project - Sport Result Prediction App
Комментарии