samedi 2 octobre 2021

materializecss 1.0.0 reinitialize after dom change with jquery - ERROR: TypeError: Right-hand side of 'instanceof' is not callable

Good day,

I have a project that uses materializecss with jQuery. I have a DOM that is already filled with materialize elements, everything works wonderfully there.

However, as soon as I generate a "popup" that contains new DOM elements (such as a datepicker) they do not work. According to the documentation I could read that an M.AutoInit() is running at the beginning and therefore the elements are not yet initialized.

How do I ensure that all elements - whether popup or not - always work?

If I try to initialize a date selector again, I get the following error:

materialize.min.js:6 Uncaught TypeError: Right-hand side of 'instanceof' is not callable

This is how it worked for the elements not included in the popup:

$('.datepicker').datepicker(<options>);



Aucun commentaire:

Enregistrer un commentaire