Topic: Date Picker doesn't appear from Ajax call
yorkmyers priority asked 6 days ago
I'm making an Ajax call that returns HTML, which is trying to display a Date Picker.
While the Date Picker works upon initial page load (without an Ajax call)... it appears a a regular input box from the Ajax call.
Can you please share how I can re-initialize Date Pickers from dynamically loaded items?
I'm guessing it would be similar to this question previously posted that involved tooltips needing to be re-initialized upon datatable.
kpienkowska staff answered 6 days ago
You need to init your datepicker after it is added with JS:
const myDatepicker = new mdb.Datepicker(document.getElementById('myDatepicker'))
yorkmyers priority commented 5 days ago
This works; thank you!
yorkmyers priority answered 5 days ago
while it does work, I do get an error in the console:
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 3.11.0
- Device: Desktop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: Yes