ConfirmDialogBox with callback function
When on click event of both button into footer of DialogBox fired, functions are called.
In this sample, I use an anonymous function on click event button "--" fired.
NB: in parameters, the name of callback function is given without brackets. Callbacks functions are optionnal.
Source Code
$(document).ready(function() {
//To use advanced settings, you must define var.
var msg = new AntMessageBox();
var nb_callback = 0;
//the callback function
function increase_CB() {
nb_callback++;
}
$("#open").click(function () {
//Variables of AntMessageBox
var content = "<article style='width: 650px'><div>Click to increase the number below...</div>"
content += "<div>nb callbacks = "+nb_callback+"</div></article>";
var title ="Try callback function";
var target_element_id = "#zone"; //you can use all selector's of jQuery to select target of content of MsgDialogBox
var label="++";
//Message box initialized
msg.initDialogBox(title, target_element_id);
msg.ConfirmDialogBox(content, increase_CB, function(){nb_callback--;}, label, "--");
});
});