Replace confirm with radconfirm in drag-and-drop demo

4 posts, 1 answers
  1. Paul J
    Paul J avatar
    101 posts
    Member since:
    Nov 2008

    Posted 29 Jul 2010 Link to this post

    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.
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 03 Aug 2010 Link to this post

    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
  3. Paul J
    Paul J avatar
    101 posts
    Member since:
    Nov 2008

    Posted 04 Aug 2010 Link to this post

    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?
  4. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 09 Aug 2010 Link to this post

    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
Back to Top