kartik-v/yii2-editable

Can't trigger success event

Closed this issue · 2 comments

everything works fine but when I use editableSuccess never happen though controller returns success in message
"editableSuccess"=>"function(event, val, form, data) { alert('Successful submission of value ' + val); }",

Cannot reproduce this. You may need to check your code and configuration. The editableSuccess will fire after ajax submission of the editable form.

Same issue I am facing any update please
here is my code simple

<?=
                    Editable::widget([
                        'format' => 'link',
                        'asPopover' => false,
                        'type' => Editable::INLINE_AFTER_1,
                        'inlineSettings' => [
                            'options' => ['class' => ''],
                            'closeButton' => '<button type="button" class="btn btn-default no-shadow kv-editable-close" title="Cancel">Cancel</button>'
                        ],
                        'displayValue' => 'Click to change email',
                        'buttonsTemplate' => '{submit}&nbsp;&nbsp;',
                        'showButtonLabels' => TRUE,
                        'submitButton' => [
                            'icon' => '',
                            'label' => 'Change',
                            'class' => 'btn btn-success no-shadow kv-editable-submit'
                        ],
                        'model' => $model,
                        'attribute' => 'email',
                        'size' => 'md',
                        'options' => ['class' => 'form-control', 'placeholder' => 'Enter email...'],
                        'pluginEvents' => [
                            'editableSuccess' => 'function(event, val, form, data){ console.log(val); console.log(data.url); if(data.status){ window.location.href = data.url; } }'
                        ]
                    ]);
                    ?>

No console error
No server side error while email is updating fine.
Even other events like editableChange are working fine but editableSuccess not triggering while controller return json response correctly.