Is there a way to use a jquery dialog modal instead of the javascript confirm message with the Treeview? When a user drags a node to another on a tree I am executing the client side event "OnClientNodeDropping", what I want to do is show a jquery dialog asking the user to confirm the move. I would want the OK and Cancel button of the modal dialog to pass a value to args.set_cancel(dialog_result); When I try this the page execute before the dialog can return a true or false confirmation. How can I swap out the old school confirm for a jquery modal dialog
function OnNodeDropped(sender, args) {
var srcNode = args.get_sourceNode();
var destNode = args.get_destNode();
var dNode = destNode._contentElement.innerHTML.indexOf("inActiveCategory");
if (dNode >= 0) {
//Call a modal dialog here and return true of false instead of using the old school confirm
var result = confirm("This category is inactive. Moving to " + destNode.get_text() + " will set " + srcNode.get_text() + " to inactive as well! ");
//get the return value from the dialog, is it canceled or ok
args.set_cancel(dialog_result);
}
}
function OnNodeDropped(sender, args) {
var srcNode = args.get_sourceNode();
var destNode = args.get_destNode();
var dNode = destNode._contentElement.innerHTML.indexOf("inActiveCategory");
if (dNode >= 0) {
//Call a modal dialog here and return true of false instead of using the old school confirm
var result = confirm("This category is inactive. Moving to " + destNode.get_text() + " will set " + srcNode.get_text() + " to inactive as well! ");
//get the return value from the dialog, is it canceled or ok
args.set_cancel(dialog_result);
}
}