Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $form = ActiveForm::begin(); ?>
- <?= $form->field($model, 'judul')->textInput(['maxlength' => true]) ?>
- <?= $form->field($model, 'isi')->textarea(['rows' => 6]) ?>
- <?= $form->field($model, 'kategori_id', [
- 'addon' => ['append' =>
- ['content'=>
- Html::button('x', ['class'=>'btn btn-default','name' => 'del_kat', 'id' => 'del_kat', 'onclick' => '$("#kat_id").val("");']) . PHP_EOL .
- Html::button('Cari', ['class'=>'btn btn-primary','id' => 'modal_kat', 'onclick' => '$("#kategori_dialog").dialog("open"); return false;' ]),
- 'asButton' => true
- ]
- ]
- ])->textInput(['id'=> 'kat_id', 'readonly' => true]) ?>
- GridView::widget([
- 'dataProvider' => $kategoriModel->search(Yii::$app->request->queryParams),
- 'filterModel' => $kategoriModel,
- 'columns' => [
- 'kategori_id',
- 'nama',
- [
- 'label' => 'test',
- 'format' => 'raw',
- 'value' => function ($data) {
- return Html::button('+', ['class'=>'btn btn-default','id' => 'modal_kat', 'onclick' => '$("#kategori_dialog").dialog("close"); $("#kat_id").val("'.$data->kategori_id.'");' ]);
- },
- ],
- ],
- ]);
- Dialog::begin([
- 'id' => 'kategori_dialog',
- 'clientOptions' => [
- 'modal' => true,
- 'autoOpen'=>false,
- 'title'=>'List Kategori',
- 'width'=>'auto',
- ],
- ]);
- Pjax::begin(['id' => 'kategori-pjax', 'enablePushState'=>false]);
- echo $kategoriGrid;
- Pjax::end();
- Dialog::end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement