}
if ((!$ajax || $ajax == 'ppxs-person-xsetting-grid') && Yii::app()->user->checkAccess("D2person.PpxsPersonXSetting.View")) {
    Yii::beginProfile('ppxs_pprs_id.view.grid');
    ?>

<div class="table-header">
    <?php 
    echo Yii::t('D2personModule.model', 'Ppxs Person Xsetting');
    ?>
    <?php 
    if (Yii::app()->user->checkAccess("D2person.PpxsPersonXSetting.Create")) {
        $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'ajaxButton', 'type' => 'primary', 'size' => 'mini', 'icon' => 'icon-plus', 'url' => array('//d2person/ppxsPersonXSetting/ajaxCreate', 'field' => 'ppxs_pprs_id', 'value' => $modelMain->primaryKey, 'ajax' => 'ppxs-person-xsetting-grid'), 'ajaxOptions' => array('success' => 'function (html) {$.fn.yiiGridView.update(\'ppxs-person-xsetting-grid\');}'), 'htmlOptions' => array('title' => Yii::t('D2personModule.crud_static', 'Add new record'), 'data-toggle' => 'tooltip')));
    }
    ?>
</div>

<?php 
    if (empty($modelMain->ppxsPersonXSettings)) {
        $model = new PpxsPersonXSetting();
        $model->ppxs_pprs_id = $modelMain->primaryKey;
        $model->save();
        unset($model);
    }
    $model = new PpxsPersonXSetting();
    $model->ppxs_pprs_id = $modelMain->primaryKey;
    // render grid view
    $can_edit_ppxs = Yii::app()->user->checkAccess("D2person.PpxsPersonXSetting.Update");
    $bft = !$can_edit_ppxs ? 'false' : 'true';
    $this->widget('TbGridView', array('id' => 'ppxs-person-xsetting-grid', 'dataProvider' => $model->search(), 'template' => '{summary}{items}', 'summaryText' => '&nbsp;', 'htmlOptions' => array('class' => 'rel-grid-view'), 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'ppxs_psty_id', 'value' => '(!' . $bft . ' && !empty($data->ppxs_psty_id))?$data->ppxsPsty->itemLabel:""', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//d2person/ppxsPersonXSetting/editableSaver'), 'source' => CHtml::listData(PstySettingType::model()->findAll(array('limit' => 1000)), 'psty_id', 'itemLabel'), 'apply' => $can_edit_ppxs)), array('class' => 'editable.EditableColumn', 'name' => 'ppxs_value', 'editable' => array('url' => $this->createUrl('//d2person/ppxsPersonXSetting/editableSaver'), 'apply' => $can_edit_ppxs)), array('class' => 'editable.EditableColumn', 'name' => 'ppxs_notes', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('//d2person/ppxsPersonXSetting/editableSaver'), 'apply' => $can_edit_ppxs)), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'FALSE'), 'update' => array('visible' => 'FALSE'), 'delete' => array('visible' => 'TRUE')), 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("/d2person/ppxsPersonXSetting/delete", array("ppxs_id" => $data->ppxs_id))', 'deleteConfirmation' => Yii::t('D2personModule.crud_static', 'Do you want to delete this item?'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip'), 'visible' => Yii::app()->user->checkAccess("D2person.PpxsPersonXSetting.Delete")))));
    Yii::endProfile('ppxs_pprs_id.view.grid');
}
 public function actionAjaxCreate($field, $value)
 {
     $model = new PpxsPersonXSetting();
     $model->{$field} = $value;
     try {
         if ($model->save()) {
             return TRUE;
         } else {
             return var_export($model->getErrors());
         }
     } catch (Exception $e) {
         throw new CHttpException(500, $e->getMessage());
     }
 }