The basics are to include the asset, then add this JS:
/**
* Override the default yii confirm dialog. This function is
* called by yii when a confirmation is requested.
*
* @param message the message to display
* @param okCallback triggered when confirmation is true
* @param cancelCallback callback triggered when cancelled
*/
yii.confirm = function (message, okCallback, cancelCallback) {
swal({
title: message,
type: 'warning',
showCancelButton: true,
closeOnConfirm: true,
allowOutsideClick: true
}, okCallback);
};
It would be great if this code was part of this yii2 extension. Even if it was in the documentation it would be great.
There is a great answer here that allows a simple replacement of Yii2's default data-confirm popup: http://stackoverflow.com/a/33434184/599477
The basics are to include the asset, then add this JS:
It would be great if this code was part of this yii2 extension. Even if it was in the documentation it would be great.