Skip to content

Dynamic load the modal from the backend #20

Closed Answered by axzilla
adlecluse asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand your problem correctly, you want to dynamically load content (specifically an employee selection list) into a modal after it opens, rather than including it in the initial page load.

@components.ModalBody() {
  <div
    hx-get="/api/employees" 
    hx-trigger="intersect once"
    hx-indicator="#loading"
  >
    <div id="loading" class="flex justify-center p-4">
      <div class="animate-spin h-8 w-8 border-4 border-primary border-t-transparent rounded-full"></div>
    </div>
  </div>
}

What do you think about this solution?

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@dimmerz92
Comment options

@adlecluse
Comment options

@dimmerz92
Comment options

@axzilla
Comment options

Answer selected by adlecluse
@dimmerz92
Comment options

@adlecluse
Comment options

@axzilla
Comment options

@adlecluse
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants