This is a migrated thread and some comments may be shown as answers.

TreeView jquery modal instead of javascript confirm

1 Answer 85 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Chris Berry
Top achievements
Rank 1
Chris Berry asked on 06 Oct 2011, 04:30 PM
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);
            }
        }

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Oct 2011, 04:34 PM
Hello Chris,

Would you please explain what exactly is the jquery modal dialog that you have in mind and what is the reason of using it? I am sending you a working demo project with the general use-case. Would you please modify it to show your idea?

Best wishes,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Chris Berry
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or