?>
        <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 
    }
    $model = new VtrdTrailerDoc();
    $model->vtrd_vtrl_id = $modelMain->primaryKey;
    // render grid view
    $this->widget('TbGridView', array('id' => 'vtrd-trailer-doc-grid', 'dataProvider' => $model->search(), 'template' => '{summary}{items}', 'summaryText' => '&nbsp;', 'htmlOptions' => array('class' => 'rel-grid-view'), 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'vtrd_vtdt_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//trucks/vtrdTrailerDoc/editableSaver'), 'source' => CHtml::listData(VtdtTruckDocType::model()->findAll(array('limit' => 1000)), 'vtdt_id', 'itemLabel'))), array('header' => Yii::t('TrucksModule.model', 'Exp.Postion'), 'type' => 'raw', 'value' => '!empty($data->vtrd_fixr_id)?
                                    $data->vtrdFixr->fixrFiit->fiitFinv->finv_number.
                                    "&nbsp;".
                                    CHtml::link(
                                        "<i class=\\"icon-external-link\\"></i>",
                                        array(
                                            "/d2fixr/FixrFiitXRef/viewFinv",
                                            "finv_id"=>$data->vtrdFixr->fixrFiit->fiit_finv_id
                                        ),
                                        array("target" => "_blank")
                                    )
                                    :"-"'), array('class' => 'editable.EditableColumn', 'name' => 'vtrd_number', 'editable' => array('url' => $this->createUrl('//trucks/vtrdTrailerDoc/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'vtrd_issue_date', 'editable' => array('type' => 'date', 'url' => $this->createUrl('//trucks/vtrdTrailerDoc/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'vtrd_expire_date', 'editable' => array('type' => 'date', 'url' => $this->createUrl('//trucks/vtrdTrailerDoc/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'vtrd_notes', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('//trucks/vtrdTrailerDoc/editableSaver'))), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'FALSE'), 'update' => array('visible' => 'FALSE'), 'delete' => array('visible' => 'empty($data->vtrd_fixr_id) && Yii::app()->user->checkAccess("Trucks.VtrlTrailer.DeletevtrdTrailerDocs")')), 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("/trucks/vtrdTrailerDoc/delete", array("vtrd_id" => $data->vtrd_id))', 'deleteConfirmation' => Yii::t('TrucksModule.crud', 'Do you want to delete this item?'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip')))));
    Yii::endProfile('vtrd_vtrl_id.view.grid');
 public function loadModel($id)
 {
     $m = VtrdTrailerDoc::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('TrucksModule.crud_static', 'The requested page does not exist.'));
     }
     return $model;
 }