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

RadDock handle Client-side Close command

1 Answer 104 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Devon
Top achievements
Rank 1
Devon asked on 10 Jan 2011, 03:42 PM
I'm trying to handle a RadDock close command client side so that I can set some other booleans in javascript, but I can't figure it out. I tried doing:
<tel:DockCommand OnClientCommand="CloseEmail" />

then having a javascript function

function CloseEmail(sender, eventArgs) {
    if (sender.get_dockZoneID() != "") {
        showingEmailDetail = false;
        sender.set_closed(true);
    }
}

but that wasn't firing (I put an alert() in there that wasn't showing).
I also tried using
<tel:DockCloseCommand OnClientCommand="CloseEmail" />

but that didn't fire it either. The javascript function is declared globally. Any ideas?

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 11 Jan 2011, 04:33 PM
Hello Devon,

 To attach a handler for the closure of the dock you should not specify it in additional tag (this is used to add commands) but to set the property to your function as shown below:

<telerik:raddock id="RadDock1" runat="server" 
                                onclientcommand="CloseEmail" 
  
-----------
-----------
  
<script type="text/javascript">
  
function CloseEmail(sender, args)
{
   if(args.Command.get_name() == "Close")
{
   //custom close code goes here
}
}
  
</script>

A sample demo where you can see this is available below:

http://demos.telerik.com/aspnet-ajax/dock/examples/clientsideevents/defaultcs.aspx

Kind regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Dock
Asked by
Devon
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or