Yii Framework Forum: In Dynamic form Kartik Datetimepicker is not working - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

In Dynamic form Kartik Datetimepicker is not working Rate Topic: -----

#1 User is offline   Sandip Sanghani 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 16-December 16

Posted 17 January 2017 - 01:22 AM

Quote

when i click on [+] kartik datetimepicker is not working below is my code

<div class="row">
        <div class="panel panel-default">
            <div class="panel-heading"><h4><i class="glyphicon glyphicon-envelope"></i>Pickup Points</h4></div>
                <div class="panel-body">
                    <?php DynamicFormWidget::begin([
                        'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]
                        'widgetBody' => '.container-items', // required: css class selector
                        'widgetItem' => '.item', // required: css class
                        'limit' => 5, // the maximum times, an element can be cloned (default 999)
                        'min' => 1, // 0 or 1 (default 1)
                        'insertButton' => '.add-item', // css class
                        'deleteButton' => '.remove-item', // css class
                        'model' => $modelsChild[0],
                        'formId' => 'dynamic-form',
                        'formFields' => [
                            'pickup_Name',
                            'Pickup_Address',
                            'pickup_lat',
                            'pickup_long',
                            'pickup_Datetime',
                            'pickup_Mobileno',
                        ],
                    ]); ?>

                <div class="container-items"><!-- widgetContainer -->
                    <?php foreach ($modelsChild as $i => $modelChild): ?>
                        <div class="item panel panel-default"><!-- widgetBody -->
                            <div class="panel-heading">
                                <h3 class="panel-title pull-left">Pickup Points</h3>
                                <div class="pull-right">
                                    <button type="button" class="add-item btn btn-success btn-xs"><i class="glyphicon glyphicon-plus"></i></button>
                                    <button type="button" class="remove-item btn btn-danger btn-xs"><i class="glyphicon glyphicon-minus"></i></button>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        <div class="panel-body">
                            <?php
                                // necessary for update action.
                                if (! $modelChild->isNewRecord) {
                                    echo Html::activeHiddenInput($modelChild, "[{$i}]Load_ID");
                                }
                            ?>
                            <div class="row">
                                <div class="col-sm-12">
                                    <?= $form->field($modelChild, "[{$i}]pickup_Name")->textInput(['maxlength' => true]) ?>
                                </div>                              
                            </div> 
                            <div class="row">
                                <div class="col-sm-6">
                                    <?= $form->field($modelChild, "[{$i}]Pickup_Address")->textInput(['maxlength' => true]) ?>
                                </div>
                                <div class="col-sm-6">
                                    <?= $form->field($modelChild, "[{$i}]pickup_lat")->textInput(['maxlength' => true]) ?>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <?= $form->field($modelChild, "[{$i}]pickup_long")->textInput(['maxlength' => true]) ?>
                                </div>
                                <div class="col-sm-6">
                                    <?php
                                        echo $form->field($modelChild, "[{$i}]pickup_Datetime")->widget(DatePicker::classname(), [
                                        'options' => ['placeholder' => 'Please enter employment end date'],
                                        'pluginOptions' => [
                                        'autoclose'=>true,
                                        'format' => 'dd/mm/yyyy'
                                        ]
                                        ]);
                                        ?>
                                    <?php $form->field($modelChild, "[{$i}]pickup_Datetime")->textInput(['maxlength' => true]) ?>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <?= $form->field($modelChild, "[{$i}]pickup_Mobileno")->textInput(['maxlength' => true]) ?>
                                </div>                              
                            </div>
                    </div>
                </div>
            <?php endforeach; ?>
            </div>
            <?php DynamicFormWidget::end(); ?>
        </div>
    </div>
</div>


Quote

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users