Inline Edit like scriptaculous

Hi,

What is the best way to perform inline edit in Yii? I used to like scriptaculous because it was very easy to implement.

Please suggest a similar option.

Thanks,

Vikas

You can use JQuery(ajax), JQuery is integrated with Yii.

Thanks, is there an example I can refer to?

jquery.jeditable.

I looked at that extension but there is not much explanation for a beginner like myself.

Do you have any simple example to install and run?

I am also looking in the mean time.

thank and br

Here’s the full explanation of client-side.

For server-side you can use something like this:




public function actionEditDescription() {

    $id = $_POST['id'];

    if ($id) {

        $record = MyModel::model()->findByPk($id);

        if ($record) {

            $record->description = $_POST['value'];

            $record->save();

        }

    }

    echo $_POST['value'];

    exit;

}



Thanks! It seems like a good start…