Topic: Do you consider adding the functionality of event rebinding?
ankio priority asked 5 months ago
I'm using pjax to load pages, but I found a problem that the input fields lose their original style after being loaded by pjax. I guess it may be because the elements are not associated with the relevant events after pjax loading.I tried to reload mdb.min.js after pjax loading, but I found that many events were bound repeatedly.So I hijacked Element.prototype.addEventListener and tried to remove these event listeners after pjax loading, but I couldn't remove these events. I think the best solution is for the official library to provide a method for reloading or rebinding events on updated elements after pjax loading.
Our components work in such a way that they are initialized when the MDB file is loaded. So if you add some content dynamically, it won't be initialized automatically. As you've noticed with inputs, this causes the input styles are not set. But you can do component initialization yourself. In our documentation in the API tab, you will find how to execute init via JS. If you do this, the appropriate styles will be set and the necessary events will be attached to make the component work properly
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: Mac
- Browser: Chrome
- OS: MacOS
- Provided sample code: No
- Provided link: No