Create With Tbgridview Same Page


I am using TbGridView to list the data,


to submit the form and save I am using :

echo CHtml::ajaxSubmitButton('create',Yii::t('app', 'createajax'));


  public function actionCreateAjax(){


             $model = new TableTemp;


        if (isset($_POST['TableTemp'])) {


            $model->attributes = $_POST['TableTemp'];

            if ($model->save()){

           $dataProvider = new CActiveDataProvider('TableTemp');

            $this->render('create', array(

            'model' => $model,'dataprovider'=>$dataprovider






How I can show the grid in index.php(list of my records) under the create form, every ajax(new record) the list get updated,

This topic might help you