Closed pablougas closed 8 years ago
Hope this helps someone in the future!
$(".nested-fields").on("mouseover mouseout", ".datetimepicker", function(){ $(this).datetimepicker() })
Hey @pablougas how did you integrate that code on your page please? I have been going around for a few hours now, nothing that i tried works.
In cocoon you should be wrapping the elements in nested-fields element. Basically, the issue is that the dynamic elements hadn't been initiated with dateti e picker. I solved it by using that mouseover to quickly initialize it before someone could actually click. I could've probably done it a lot cleaner and this function will continue to reinitialize an object which isn't necessary so there could also probably use a gaurd of some sort. What's your current code look like?
I have a question on how one might get this to work with dynamically added forms.