Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

How can I use callback #105

Closed
raycheel opened this issue Apr 30, 2014 · 2 comments
Closed

How can I use callback #105

raycheel opened this issue Apr 30, 2014 · 2 comments
Assignees
Labels

Comments

@raycheel
Copy link

Hello! I try use callback. If data success update then i need to display modal window. But its not working! Help please! I dont know, how it works. Write me please.
My code:
In form:

<?php
    $this->widget('editable.EditableField', array(
    'type' => 'select',
    'params' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken),
    'model' => $model,
    'attribute' => 'category_id',
    'url' => $this->createUrl('course/updateSameInfo'),
    'source' => Editable::source(Coursecat::model()->findAll(), 'id', 'name'),
    'placement' => 'right',
    ));
?>
In controller
public function actionUpdateSameInfo()
{
 $es = new EditableSaver('Course'); //'User' is name of model to be updated
 $es->update();
}

It make me sad :(

@Julian-B90
Copy link
Collaborator

Hello raycheel,

Try it out

<?php
    $this->widget('editable.EditableField', array(
    'type' => 'select',
    'params' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken),
    'model' => $model,
    'attribute' => 'category_id',
    'url' => $this->createUrl('course/updateSameInfo'),
    'source' => Editable::source(Coursecat::model()->findAll(), 'id', 'name'),
    'placement' => 'right',
    'options' => array(
         'success' => 'js:function(data) {
            #show modal 
         }'
     )
    ));
?>

@Julian-B90 Julian-B90 self-assigned this May 1, 2014
@raycheel
Copy link
Author

raycheel commented May 2, 2014

Thanks! It help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants