Example #1
0
//print_r($model->items);
//Yii::$app->end();
echo app\widgets\GridView::widget(array('id' => 'acc-templateItem-grid', 'dataProvider' => $items->search(), 'filter' => $items, 'columns' => array(array('name' => 'eavFields_id', 'value' => '$data->EavFields->name'), array('class' => 'yii\\grid\\ActionColumn', 'template' => '{remove}', 'buttons' => array('remove' => array('label' => '<i class="glyphicon glyphicon-remove"></i>', 'url' => '$data->id', 'options' => array('onclick' => 'deleteTempItm(this);return false;')))))));
app\widgets\MiniForm::end();
?>


<?php 
echo \yii\jui\Dialog::begin(array('id' => 'addnew', 'options' => array('title' => Yii::t('app', 'Add new field'), 'autoOpen' => false, 'width' => '600px')));
//bootstrap.widgets.TbModal
$form = kartik\form\ActiveForm::begin(array('id' => 'newField', 'options' => array('class' => 'well'), 'action' => array('SaveSub', 'id' => $model->id)));
?>

<div class="modal-body">
<?php 
$models = EavFields::find()->All(array('order' => 'name'));
$list = \yii\helpers\ArrayHelper::map($models, 'id', 'name');
$options = array();
$select = \yii\helpers\Html::dropDownList(ucfirst($this->id) . 'Item[eavFields_id]', 0, $list, $options);
echo $select;
?>
    <input type='hidden' value='<?php 
echo $model->id;
?>
' name='<?php 
echo ucfirst($this->id);
?>
Item[ItemTemplate_id]'>

</div>
Example #2
0






<?php 
echo \yii\jui\Dialog::begin(array('id' => 'addnew', 'options' => array('title' => Yii::t('app', 'Add new field'), 'autoOpen' => false, 'width' => '600px')));
//bootstrap.widgets.TbModal
$form = kartik\form\ActiveForm::begin(array('id' => 'newField', 'action' => array('SaveSub', 'id' => $model->id)));
?>

<div class="modal-body">
<?php 
$models = EavFields::find()->All();
//array('order' => 'name')
$list = \yii\helpers\ArrayHelper::map($models, 'id', 'name');
$options = array();
$select = \yii\helpers\Html::dropDownList(ucfirst($this->id) . 'Item[eavFields_id]', 0, $list, $options);
echo $select;
?>
    <input type='hidden' value='<?php 
echo $model->id;
?>
' name='<?php 
echo ucfirst($this->id);
?>
Item[AccTemplate_id]'>

</div>