I have Javascript that incialize datepicker after showing it in modal. When I debugged it everything looks fine, even if I trigger inicialization in console, but datepicker is still not showing itself.
Here is my JS code:
$('<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">' + '<div id="modal-container" class="modal-dialog .modal-dialog-centered" style="height:80% !important;max-width:80%;!important">' +
'<div class="modal-content" id= "modalbody" >' +
data + '</div></div></div>').modal();
$('input[data-datepicker]').datepicker({
format: 'dd.mm.yyyy',
days: ['Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek'],
daysShort: ['Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'],
daysMin: ['Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'],
months: ['Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'],
monthsShort: ['Led', 'Úno', 'Bře', 'Dub', 'Kvě', 'Čer', 'Čec', 'Srp', 'Zář', 'Říj', 'Lis', 'Pro'],
autoHide: true
});
In data property is modal body which contains following input:
<input title="@i.Value" style="padding-right:30px; width:100%" autocomplete="off" type="text" data-datepicker required class="disabled" name="@i.Id" id="@i.Id" value="@i.Value" onfocusout="return SaveEdit('@i.Id');" />
Does anyone know what is reason of it?