-
-
Save unclead/bb4edad36ee5767facb7 to your computer and use it in GitHub Desktop.
TabularInput inside Bootstrap Modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use yii\bootstrap\ActiveForm; | |
use yii\bootstrap\Modal; | |
use unclead\widgets\TabularInput; | |
use yii\helpers\Html; | |
use \unclead\widgets\examples\models\Item; | |
/* @var $this \yii\web\View */ | |
/* @var $models Item[] */ | |
?> | |
<?php | |
Modal::begin([ | |
'toggleButton' => ['label' => 'click me'], | |
]); | |
$form = \yii\bootstrap\ActiveForm::begin([ | |
'id' => 'tabular-form', | |
'enableAjaxValidation' => true, | |
'enableClientValidation' => false, | |
'validateOnChange' => false, | |
'validateOnSubmit' => true, | |
'validateOnBlur' => false, | |
'options' => [ | |
'enctype' => 'multipart/form-data' | |
] | |
]); | |
echo TabularInput::widget([ | |
'models' => $models, | |
'attributeOptions' => [ | |
'enableAjaxValidation' => true, | |
'enableClientValidation' => false, | |
'validateOnChange' => false, | |
'validateOnSubmit' => true, | |
'validateOnBlur' => false, | |
], | |
'columns' => [ | |
[ | |
'name' => 'id', | |
'type' => \unclead\widgets\TabularColumn::TYPE_HIDDEN_INPUT | |
], | |
[ | |
'name' => 'title', | |
'title' => 'Title', | |
'type' => \unclead\widgets\MultipleInputColumn::TYPE_TEXT_INPUT, | |
], | |
[ | |
'name' => 'description', | |
'title' => 'Description', | |
], | |
// [ | |
// 'name' => 'file', | |
// 'title' => 'File', | |
// 'type' => \vova07\fileapi\Widget::className(), | |
// 'options' => [ | |
// 'settings' => [ | |
// 'url' => ['site/fileapi-upload'] | |
// ] | |
// ] | |
// ], | |
[ | |
'name' => 'date', | |
'type' => \kartik\date\DatePicker::className(), | |
'title' => 'Day', | |
'options' => [ | |
'pluginOptions' => [ | |
'format' => 'dd.mm.yyyy', | |
'todayHighlight' => true | |
] | |
], | |
'headerOptions' => [ | |
'style' => 'width: 250px;', | |
'class' => 'day-css-class' | |
] | |
], | |
], | |
]); | |
echo Html::submitButton('Update', ['class' => 'btn btn-success']); | |
ActiveForm::end(); | |
Modal::end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment