// See class documentation of CActiveForm for details on this. 'enableAjaxValidation' => false, )); ?> <!-- <p class="help-block">Fields with <span class="required">*</span> are required.</p>--> <?php // echo $form->errorSummary($model); ?> <?php echo $form->textFieldControlGroup($model, 'framework_description', array('span' => 5, 'maxlength' => 255)); ?> <?php // echo $form->dropDownListControlGroup($model, 'type_id', TbHtml::listData(EamsFrameworkType::model()->findAll(), 'id', 'description'), array('prompt' => '--select--')); ?> <div class="row"> <?php echo $form->labelEx($model, 'type_id'); ?> <?php echo $form->dropDownList($model, 'type_id', CHtml::listData(EamsFrameworkType::model()->findAll(), 'id', 'description'), array( 'prompt' => '--select--', 'ajax' => array( 'type' => 'POST', 'url' => CController::createUrl('loadParents'), 'update' => '#parent_id', 'data' => array('type' => 'js:this.value'), )) ); ?> </div> <?php // echo $form->dropDownListControlGroup($model, 'parent_id', TbHtml::listData(EamsFramework::model()->findAll(), 'id', 'framework_description'), array('prompt' => '--select--')); ?> <div class="row"> <?php echo $form->labelEx($model, 'parent_id'); ?> <?php
<br><br/> <?php $this->widget('bootstrap.widgets.TbGridView', array( 'id' => 'eams-framework-grid', 'type' => TbHtml::GRID_TYPE_BORDERED, 'dataProvider' => $dataProvider, 'columns' => array( array( 'header' => '#', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', ), array( 'type' => 'html', 'name' => 'framework_description', 'value' => 'TbHtml::link($data->framework_description,Yii::app()->createUrl("/eamsFramework/admin",array("parent_id"=>$data->parent_id)))' ), array( 'name' => 'type_id', 'value' => '$data->type->description', 'filter' => TbHtml::listData(EamsFrameworkType::model()->findAll(), "id", "description") ), // 'parent_id', 'guid', array( 'class' => 'bootstrap.widgets.TbButtonColumn', ), ), )); ?>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return EamsFrameworkType the loaded model * @throws CHttpException */ public function loadModel($id) { $model = EamsFrameworkType::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }