ah. this library does look pretty cool!
http://nakupanda.github.io/bootstrap3-dialog/[
^]
note that in the "available options" section, you can set css classes on buttons...you can also set the id value.
also, there's an option to run a method "onshown".
you could use set the id as desired in the example i took from their site below ("btn-ok") and so something like this:
($"#btn-ok").focus();
OR...
you could set a custom css class (something not being used for something else - like "cancel-button-custom") and then use jquery to set the focus to that element like below:
($".cancel-button-custom").focus();
sample from the same site taken from their examples:
BootstrapDialog.show({
title: 'Say-hello dialog',
message: 'Hello world!',
buttons: [{
id: 'btn-ok',
icon: 'glyphicon glyphicon-check',
label: 'OK',
cssClass: 'btn-primary',
autospin: false,
action: function(dialogRef){
dialogRef.close();
}
}]
});
so again, i think my jsfiddle provided earlier will help - instead of setting the id of the button to pick out like i did, you can to class yours ahead of time in the libraries object setup...or you can set the id of each button and do something closer to my jsFiddle example.