Create With Tbgridview Same Page

index.php

I am using TbGridView to list the data,

_form.php(create)

to submit the form and save I am using :


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

controller.php


  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 http://www.yiiframework.com/forum/index.php/topic/31221-how-to-update-cgridview-with-ajax/