Open andhikayuana opened 8 years ago
Hey have you found any solution to this? Even im facing the same problem..
@andhikayuana : I need to add datepicker jquery dynamically after insert the form content. I had also datepicker issue in DynamicFormWidget
. You can datepicker jquery dynamically at following way :
jQuery(".dynamicform_wrapper").on("afterInsert", function(e, item) { jQuery(".dynamicform_wrapper .panel-title-address").each(function(index) { jQuery(this).html("Installment: " + (index + 1)) $("#date-"+index+"-attribute").datepicker(); }); });
You should add datepicker manually for dynamically genereted instances:
function multipleDatepickers() { $(".dynamicform_wrapper").on("afterInsert afterDelete", function(e, item) { var VarItemsQuantity = $('.item').length, VarCounter = 1; for(VarCounter; VarCounter < VarItemsQuantity; VarCounter++) { $('#WorkExperiencesModel-' + VarCounter + '-StartDate'). parent().datepicker({"autoclose":true, "format":"dd-M-yyyy", 'language':'ru',}); $('#WorkExperiencesModel-' + VarCounter + '-EndDate'). parent().datepicker({"autoclose":true, "format":"dd-M-yyyy", 'language':'ru',}); }; }); }
https://github.com/2amigos/yii2-date-picker-widget/issues/11
Please see this issue.. Default value don't work in kartik datapicker dymanic form
Thanks
Hi Andhika
Did you manage to get this sorted out?
I am having a similar issue and all of the solutions I have found are for when there is a minimum of 1 dynamic forms. My software, like yours is for zero or more dynamic forms.
Thank you
Tony
Hello, im Andhika from Indonesia,
I have some problem using your yii2 extension, especialy the bootstrap datepicker is not show up. this is my form looks :
when i clicked the date input on red area, is not show up the bootstrap im using 2amigos/yii2-date-picker-widget
on the console not showing error
this is the expectation :
view