You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is not an issue ,its my custom requirement but I can't any other better place to post thats why I post this here .currently I write bellow core , but I want dome more parameter in b1checkConfirm(result,param1,param2)...etc or object like b1checkConfirm(result,{id:1,name:"name"}) is it possible? if yes .how?
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/css/bootstrap-dialog.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/js/bootstrap-dialog.min.js"></script>
<script>
function callconfirm(cb)
{
// var isConfirmed
BootstrapDialog.confirm({
title: 'WARNING',
message: 'Warning! Drop your banana?',
type: BootstrapDialog.TYPE_WARNING, // <-- Default value is BootstrapDialog.TYPE_PRIMARY
closable: false, // <-- Default value is false
draggable: false, // <-- Default value is false
btnCancelLabel: 'Do not drop it!', // <-- Default value is 'Cancel',
btnOKLabel: 'Drop it!', // <-- Default value is 'OK',
btnOKClass: 'btn-warning', // <-- If you didn't specify it, dialog type will be used,
callback:cb /*function(result) {
// result will be true if button was click, while it will be false if users close the dialog directly.
if(result) {
return true;
}else {
return false;
}
}*/
});
}
function b1checkConfirm(result)
{
//callconfirm();
console.log("B1 click and result is "+result);
}
function b2checkConfirm(result)
{
//callconfirm();
console.log("B2 click and result is "+result);
}
</script>
</head>
<body>
<button type="button" onclick="callconfirm(b1checkConfirm)" style="height: 50px;width: 50px" >B1</button>
<button type="button" onclick="callconfirm(b2checkConfirm)" style="height: 50px;width: 50px" >B2</button>
</body>
The text was updated successfully, but these errors were encountered:
kuntalbose
changed the title
BootstrapDialog confirm callback with extra parameters
BootstrapDialog confirm dynamic callback with extra parameters
Feb 16, 2017
Thanks Dante for your reply ,the situation is I have bind some records in a table and each record has a delete button I want to notify user with a confirmation and if user confirm the data will be delete .that's why
I want to pass the record ID as parameter to to the call back method.If you have any other idea please suggest .
I think this is not an issue ,its my custom requirement but I can't any other better place to post thats why I post this here .currently I write bellow core , but I want dome more parameter in b1checkConfirm(result,param1,param2)...etc or object like b1checkConfirm(result,{id:1,name:"name"}) is it possible? if yes .how?
The text was updated successfully, but these errors were encountered: