Thursday, July 6, 2017

datepicker with nested form field

Indeed, you will have to retrigger the datepicker plugin. You are probably doing something like
$('datepicker').some_function_to_do_your_datepicker_styling();
But of course, the dynamically added elements are not yet in the DOM.
So do something like:
$('form').on('cocoon:after-insert', function() {
  /* apply datepicker styling */ 
});

1 comment: