Confirm before deleting a dock

7 posts, 0 answers
  1. shimon
    shimon avatar
    37 posts
    Member since:
    Apr 2007

    Posted 08 Nov 2007 Link to this post

    Hello,

    I tried to ask a user to confirm a delete of a dock, but i can't do a confirmation because the dock have been removed from the zone before i get the command close from it.

    How can i ask a confirmation on click the close icon of the dock?

    Thanks,
    Shimon
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 08 Nov 2007 Link to this post

    Hello shimon,

    Please, find attached the following example that I prepared to demonstrate how to display a confirm before closing a RadDock Prometheus and depending on the user selection close it or not. Let me know if you have any questions regarding the implemenation.

    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. shimon
    shimon avatar
    37 posts
    Member since:
    Apr 2007

    Posted 08 Nov 2007 Link to this post

    Hello Petya,

    Your implemenation solved the problem i had till now.

    Thank you,
    Shimon
  5. shimon
    shimon avatar
    37 posts
    Member since:
    Apr 2007

    Posted 09 Nov 2007 Link to this post

    Hello Petya,

    This code doesn't work: 
    dock._commands.Close.onCommand();

    dock._commands.Close is null object.

    i'm using q1 build 2007.1.626.0

    please help me to solve this.

    Thank you,
    Shimon

  6. Petya
    Admin
    Petya avatar
    869 posts

    Posted 09 Nov 2007 Link to this post

    Hello shimon,

    Please, upgrade to a later version of Telerik.Web.UI to solve this problem. We suggest upgrading not only because of this particular issue you have but because the newer versions fix many problems of the older versions. Let me know if the problem persists with the latest version.


    Greetings,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Sean
    Sean avatar
    200 posts
    Member since:
    Nov 2010

    Posted 29 Mar 2011 Link to this post

    Hi Telerik,

    Is this example still valid for the latest version of Telerk.Web.UI? I am experiencing the following issue -- when I click 'cancel' the dock stays, but if I attempt to move the dock around it immediately disappears.

    Sean
  8. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 31 Mar 2011 Link to this post

    Hello Sean,

    No, the example is not valid, because some of the RadDock's client-side functionality has been changed since then. To make the example work with the latest version you need to make two changes:
    1. In the OnClientCommand function change the args.Command.get_Name() line to args.Command.get_name():
      function OnClientCommand(dock, args)
      {
          if (args.Command.get_name() == "Close")
          {
              dock.get_element().style.display = "";
              if (!isServerCommandExecute)
              {
                  args.set_cancel(true);
                  currentDockID = dock.get_id();
                  radconfirm('Are you sure?!', confirmCallBackFn, 330, 100);
              }
              isServerCommandExecute = false;
          }
      }
    2. In the confirmCallBackFn function add the highlighted line, to make sure the dock stays open when moving it:
      function confirmCallBackFn(arg)
      {
          alert("Confirm returned the following result: " + arg);
          var dock = $find(currentDockID);
          if (arg == true)
          {
              isServerCommandExecute = true;
              dock._commands.Close.onCommand();
          }
       
          else
          {
              isServerCommandExecute = false;
              dock._closed = false;
              dock.get_element().style.display = "";
          }
      }

    Let me know if you have other questions.

    Regards,
    Pero
    the Telerik team
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017