public function loadModel($id)
 {
     $m = CcdpDepartment::model();
     // apply scope, if available
     $scopes = $m->scopes();
     if (isset($scopes[$this->scope])) {
         $m->{$this->scope}();
     }
     $model = $m->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('D2companyModule.crud', 'The requested page does not exist.'));
     }
     return $model;
 }
</div>
 
<?php 
    if (!empty($grid_error)) {
        ?>
        <div class="alert alert-error"><?php 
        echo $grid_error;
        ?>
</div>
        <?php 
    }
    if (!empty($grid_warning)) {
        ?>
        <div class="alert alert-warning"><?php 
        echo $grid_warning;
        ?>
</div>
        <?php 
    }
    if (!empty($modelMain->ccdpDepartments) || $model !== false) {
        $model = new CcdpDepartment();
        $model->ccdp_ccmp_id = $modelMain->primaryKey;
        // render grid view
        $this->widget('TbGridView', array('id' => 'ccdp-department-grid', 'dataProvider' => $model->search(), 'template' => '{summary}{items}', 'summaryText' => '&nbsp;', 'htmlOptions' => array('class' => 'rel-grid-view'), 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'ccdp_name', 'editable' => array('url' => $this->createUrl('//d2company/ccdpDepartment/editableSaver'), 'apply' => Yii::app()->user->checkAccess("D2company.CcdpDepartment.Update"))), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'FALSE'), 'update' => array('visible' => 'FALSE'), 'delete' => array('visible' => 'Yii::app()->user->checkAccess("D2company.CcdpDepartment.Delete")')), 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("/d2company/ccdpDepartment/delete", array("ccdp_id" => $data->ccdp_id))', 'deleteConfirmation' => Yii::t('D2companyModule.crud', 'Do you want to delete this item?'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip')))));
    }
    ?>

<?php 
    Yii::endProfile('ccdp_ccmp_id.view.grid');
}
$this->widget('d2FilesWidget', array('module' => $this->module->id, 'model' => $modelMain));