if (Yii::$app->session->getFlash('crear')) { echo growl\Growl::widget(['type' => growl\Growl::TYPE_SUCCESS, 'title' => 'Registro Creado', 'icon' => 'glyphicon glyphicon-ok-sign', 'body' => 'Se agrego correctamente ' . Yii::$app->session->getFlash('crear'), 'showSeparator' => true, 'delay' => 0, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]); } } ?> <?php $gridColumns = [['width' => '25px', 'class' => 'kartik\\grid\\SerialColumn'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{delete}', 'width' => '25px'], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'unidad', 'editableOptions' => function () { return ['asPopover' => false, 'options' => ['style' => 'width:100px']]; }, 'value' => function ($model) { return $model->unidad; }], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'descripcion', 'editableOptions' => function () { return ['asPopover' => false, 'options' => ['style' => 'width:200px']]; }, 'value' => function ($model) { return $model->descripcion; }], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'tipo_unidad', 'width' => '12em', 'value' => function ($model) { return $model->tipo_unidad; }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => \backend\modules\mrp\models\Unidadmedida::arreglotipounidad(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Unidad'], 'editableOptions' => function () { return ['size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'options' => ['data' => \backend\modules\mrp\models\Unidadmedida::arreglotipounidad()]]; }]]; echo \kartik\grid\GridView::widget(['export' => false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns]); ?> <div class="unidadmedida-create"> <?php echo $this->render('_form', ['modelunidad' => $modelunidad]); ?> </div> </div>
?> <div class="col-sm-2"> <?php echo $form->field($modelunidad, 'unidad', ['showLabels' => false])->textInput(['placeholder' => 'Unidad']); ?> </div> <div class="col-sm-4"> <?php echo $form->field($modelunidad, 'descripcion', ['showLabels' => false])->textInput(['placeholder' => 'DescripciĆ³n']); ?> </div> <div class="col-sm-2"> <?php echo $form->field($modelunidad, 'tipo_unidad', ['showLabels' => false])->dropDownList(\backend\modules\mrp\models\Unidadmedida::arreglotipounidad(), ['prompt' => 'Tipo Unidad']); ?> </div> <div class="col-sm-2"> <?php echo Html::submitButton($modelunidad->isNewRecord ? 'Nueva' : 'Actualizar', ['class' => $modelunidad->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> <?php ActiveForm::end();