Error displaying a bootstrap component with JQuery innerHTML


Topic: Error displaying a bootstrap component with JQuery innerHTML or html to add content dynamically

Antons asked 2 years ago

Why when adding a mdbootstrap component via JQuery's innerHTML or html, does the functionality of the components not work despite the redundancy?

In the previous example, a component of the treeview plugin is loaded through innerHTML and the functionality when clicking on the drop-down elements does not work, I attach an example of the code used, additionally I have already tried other components of mdbootstrap for example: select, input, among others

enter image description here


kpienkowska staff answered 2 years ago

Components with HTML auto init are initiated on the initial page load.

If you add components dynamically you need to init them with js or jQuery after they are added.


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 6.1.0
  • Device: PC HP
  • Browser: Google Chrome, Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No