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

Replace confirm with radconfirm in drag-and-drop demo

3 Answers 83 Views
Window
This is a migrated thread and some comments may be shown as answers.
Paul J
Top achievements
Rank 1
Paul J asked on 29 Jul 2010, 02:34 PM
in the drag-and-drop Grid demo (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx) when dragging items to the Recyle Bin, it gives a regular confirm box. How would I replace this with a radconfirm box?

I've got it so far as that it shows the radWindow through the radconfirm call, but it doesn't give me a chance to say yes/no, and instead continues execution of removing the dragged items. how do I 'pause' the execution properly?

here's the code snippet from the demo that uses the regular confirm
var node = args.get_destinationHtmlElement();
                            if(!isChildOf('trashCan', node))
                            {
                                args.set_cancel(true);
                            }
                            else
                            {
                                if (confirm("Are you sure you want to delete this order?"))
                                    args.set_destinationHtmlElement($get('trashCan'));
                                else
                                   args.set_cancel(true);
                            }


and here's my similar code, but trying to use the radconfirm. I must be missing something?
var node = args.get_destinationHtmlElement();
                                      
           if(!isChildOf('trashCan', node))
           {
               args.set_cancel(true);
                                  
           }
           else
          {
              var callBackFn = function(arg) {
                  if (arg) {
                      args.set_destinationHtmlElement($get('trashCan'));
                  }
              }
          radconfirm("Are you sure you want to remove this user from the role?",callBackFn);
          return false;
          // if (radconfirm("Are you sure you want to remove this user from the role?",callBackFn))
         // args.set_destinationHtmlElement($get('trashCan'));                                                                              
         // else
         // args.set_cancel(true);
        }


Thanks for the help.

3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 03 Aug 2010, 03:10 PM
Hello Paul J,

Predefined RadWindow dialogs are built on HTML elements, CSS and JavaScript and they cannot block the execution thread of the browsers. We provide a solution (a simulation of blocking the thread) that works in many cases, but unfortunately it cannot be applied in your scenario, because in this case the thread have to be blocked really in order to achieve the desired result.

All the best,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul J
Top achievements
Rank 1
answered on 04 Aug 2010, 07:50 PM
Well that is disappointing.  Is there not a way I could adjust my scenario to accomplish a modal prompt when dragging items from a grid to the recycling bin for confirmation of deletion?
0
Accepted
Fiko
Telerik team
answered on 09 Aug 2010, 01:41 PM
Hello Paul J,

As I mentioned in my previous reply, the thread in this scenario must be really blocked. The predefined dialogs only simulate blocking the execution thread and this is why you need to use the standard browser dialogs, instead of the predefined ones.

Greetings,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Paul J
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Paul J
Top achievements
Rank 1
Share this question
or