?> <?php echo $form->error($model, 'cityid'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'kelurahanid'); echo $form->hiddenField($model, 'kelurahanid'); ?> <input type="text" name="kelurahan_name" id="kelurahan_name" readonly > <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'kelurahan_dialog', 'options' => array('title' => Yii::t('app', 'Sub Subdistrict'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $kelurahan = new Kelurahan('searchwstatus'); $kelurahan->unsetAttributes(); // clear any default values if (isset($_GET['Kelurahan'])) { $kelurahan->attributes = $_GET['Kelurahan']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'kelurahan-grid', 'dataProvider' => $kelurahan->Searchwstatus(), 'filter' => $kelurahan, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+", array("name" => "send_kelurahan", "id" => "send_kelurahan", "onClick" => "$(\\"#kelurahan_dialog\\").dialog(\\"close\\"); $(\\"#kelurahan_name\\").val(\\"$data->kelurahanname\\"); $(\\"#Customeraddress_kelurahanid\\").val(\\"$data->kelurahanid\\");"))'), array('name' => 'kelurahanid', 'visible' => false, 'value' => '$data->kelurahanid', 'htmlOptions' => array('width' => '1%')), 'kelurahanname'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("kelurahan-grid");$("#kelurahan_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'kelurahanid'); ?> </div>
/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $subdistrict = new Subdistrict('searchwstatus'); $subdistrict->unsetAttributes(); // clear any default values if (isset($_GET['Subdistrict'])) { $subdistrict->attributes = $_GET['Subdistrict']; } $model = new Kelurahan('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Kelurahan'])) { $model->attributes = $_GET['Kelurahan']; } if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $this->render('index', array('model' => $model, 'subdistrict' => $subdistrict)); }