kidzen / yii2-dynamicform

It is widget to yii2 framework to clone form elements in a nested manner, maintaining accessibility.
Other
16 stars 17 forks source link

duplicated kartik date picker error when i used with this extension #21

Open racielbd opened 5 years ago

racielbd commented 5 years ago

Kartik DatePicker Widget only show at row 1... when I clicked the plus [+] button I got a javascript error in my console.... TypeError: $.fn.datepicker is undefined

this is the code of where i use the widget

<?= $form->field($product, "[{$i}][{$index}]bookedDate", [
                 'template' => '<div class="col-xs-12 col-md-3">{label} {input} {error}</div>'
                ])->widget(DatePicker::classname(), [
                         'pluginOptions' => [
                         'autoclose' => true,
                         'format' => 'yyyy-mm-dd'
                ]
 ]); ?>

I'm not sure what I'm doing wrong, also try with wbraganca\dynamicform and it did not work either....

When I go to my code in the browser this is what I get...

<input type="text" id="itineraryproduct-0-1-bookeddate" class="form-control krajee-datepicker" name="ItineraryProduct[0][1][bookedDate]" data-datepicker-source="itineraryproduct-0-0-bookeddate-kvdate" data-datepicker-type="2" data-krajee-kvdatepicker="kvDatepicker_44c07868">

I realized these differences ......... id="itineraryproduct-0-1-bookeddate" data-datepicker-source="itineraryproduct-0-0-bookeddate-kvdate" ........... I do not know if it's related

I hope anyone guide me thanks

kidzen commented 5 years ago

can u share kartik datepicker version that u use? mine is working fine

kidzen commented 5 years ago

please do composer update...i have mistakenly publish dev branch..tq for your support