Closed Commifreak closed 5 years ago
May be better
$view->registerJs("
jQuery('#$id').kbModalAjax({
url: '$url',
size:'sm',
ajaxSubmit: '$this->ajaxSubmit'
});
");
try and I fix it.
Hi,
Doesnt work either, I've found the core problem: https://github.com/loveorigami/yii2-modal-ajax/blob/master/src/assets/js/kb-modal-ajax.js#L39
options.ajaxSubmit || true is always true.
Examples:
false || true => true '' || true => true 'anystring' || true => 'anystring' BUT in https://github.com/loveorigami/yii2-modal-ajax/blob/master/src/assets/js/kb-modal-ajax.js#L66 it is true again, because it is a set string!
We need a fix in the js here: If NOT false it is true.
Working perfectly now.
... it is not possible to disable ajaxSubmit, because of: https://github.com/loveorigami/yii2-modal-ajax/blob/master/src/ModalAjax.php#L154
The generated JS contains:
which leads to syntax error. PHP false for ajaxSubmit returns nothing when used there.
Corrected code would something like:
Could you re-test the ajaxSubmit option to verify if its working?