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

Confirm before deleting a dock

6 Answers 96 Views
Dock
This is a migrated thread and some comments may be shown as answers.
shimon
Top achievements
Rank 1
shimon asked on 08 Nov 2007, 11:55 AM
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

6 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 08 Nov 2007, 01:50 PM
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
0
shimon
Top achievements
Rank 1
answered on 08 Nov 2007, 02:01 PM
Hello Petya,

Your implemenation solved the problem i had till now.

Thank you,
Shimon
0
shimon
Top achievements
Rank 1
answered on 09 Nov 2007, 12:10 PM

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

0
Petya
Telerik team
answered on 09 Nov 2007, 12:21 PM
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
0
Sean
Top achievements
Rank 2
answered on 29 Mar 2011, 08:47 PM
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
0
Pero
Telerik team
answered on 31 Mar 2011, 09:00 AM
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
Tags
Dock
Asked by
shimon
Top achievements
Rank 1
Answers by
Petya
Telerik team
shimon
Top achievements
Rank 1
Sean
Top achievements
Rank 2
Pero
Telerik team
Share this question
or