Topic: initialize select after ajax load

sblite premium asked 1 year ago


Hi, How would i re-initialize a select after an ajax GET for a modal.

    document.querySelectorAll('.select').forEach((select) => {
      new mdb.Select(select);
    }),

Ive tried the above code and that works but also adds another select.

Thanks Scott


Quang Huy Nguyễn priority answered 1 year ago


Just change the "document" to the container where you load your ajax content.


Mateusz Lazaru staff commented 1 year ago

@sblite, let us know if it helped.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.2.0
  • Device: Web
  • Browser: Chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No