public function actionAjaxCreate($field, $value, $no_ajax = 0)
 {
     $model = new VtdcTruckDoc();
     $model->{$field} = $value;
     try {
         if ($model->save()) {
             if ($no_ajax) {
                 $this->redirect(Yii::app()->request->urlReferrer);
             }
             return TRUE;
         } else {
             return var_export($model->getErrors());
         }
     } catch (Exception $e) {
         throw new CHttpException(500, $e->getMessage());
     }
 }
<?php

if (!$ajax) {
    Yii::app()->clientScript->registerCss('rel_grid', ' 
            .rel-grid-view {margin-top:-60px;}
            .rel-grid-view div.summary {height: 60px;}
            ');
}
if (!$ajax || $ajax == 'vtdc-truck-doc-grid') {
    Yii::beginProfile('vtdc_vtrc_id.view.grid');
    $grid_error = '';
    $grid_warning = '';
    if (empty($modelMain->vtdcTruckDocs)) {
        $model = new VtdcTruckDoc();
        $model->vtdc_vtrc_id = $modelMain->primaryKey;
        if (!$model->save()) {
            $grid_error .= implode('<br/>', $model->errors);
        }
        unset($model);
    }
    ?>

    <div class="table-header">
        <?php 
    echo Yii::t('TrucksModule.model', 'Vtdc Truck Doc');
    $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'ajaxButton', 'type' => 'primary', 'size' => 'mini', 'icon' => 'icon-plus', 'url' => array('//trucks/vtdcTruckDoc/ajaxCreate', 'field' => 'vtdc_vtrc_id', 'value' => $modelMain->primaryKey, 'ajax' => 'vtdc-truck-doc-grid'), 'ajaxOptions' => array('success' => 'function(html) {$.fn.yiiGridView.update(\'vtdc-truck-doc-grid\');}'), 'htmlOptions' => array('title' => Yii::t('TrucksModule.crud', 'Add new record'), 'data-toggle' => 'tooltip')));
    ?>
    </div>

    <?php 
    if (empty($modelMain->vtdcTruckDocs)) {