From the course: HTMX with Thymeleaf in Spring Boot
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
hx-swap: beforeend, afterend, and deleting elements - Spring Boot Tutorial
From the course: HTMX with Thymeleaf in Spring Boot
hx-swap: beforeend, afterend, and deleting elements
- [Instructor] Let's open 03_05_begin/records-management in IntelliJ and go again back to the editable-email-form to demonstrate the beforeend hx-swap value and the afterend hx-swap value. Previously, we had used the afterbegin and beforebegin, so now it's time to talk about the beforeend hx-swap value for a moment. beforeend will basically cause the content to be appended after the last child inside the target. Looking at the hx-swap attribute on the editable-email-form, it is currently set to afterbegin, which will put the new email inside the target email-list container at the beginning, prepending this to the beginning of the DOM. So let's go ahead and change this to beforeend. And restart the application by running it from the terminal, mvn clean install spring-boot:run. In the browser, let's log in. And navigate to the person full details. And click Add Email. I'll select Work. And type an email. And hit Enter. Let's go ahead and right-click on the email we created and inspect…
Contents
-
-
-
-
-
(Locked)
Learn to use HTMX swapping5m 11s
-
(Locked)
Differentiate between inner and outerHTML swapping10m 51s
-
(Locked)
Decide when to use hx-swap: afterbegin and beforebegin8m 11s
-
(Locked)
Implement hx-on functionality to listen for hx-swap events9m 24s
-
(Locked)
hx-swap: beforeend, afterend, and deleting elements5m 11s
-
(Locked)
Implement hx-swap and use view transition API13m
-
(Locked)
Learn to use hx-swap scrolling modifiers7m 6s
-
(Locked)
Understand HTTP verbs with hypermedia6m 18s
-
(Locked)
Demonstrate hx-post and hx-delete with Spring Security11m 12s
-
(Locked)
Demonstrate hx-patch and hx-put with Spring Security9m 56s
-
(Locked)
-
-
-
-
-