Hi, I have a strange behavior on my code.
When I call the set_closed client-side method on a RadDock that has a DockCommand with OnClientCommand event attached, my script enters in a loop cycle.
Here you are a sample code that illustrates the behavior.
Just click on ShowHideRadDock1 to replicate the bug.
Thanks.
When I call the set_closed client-side method on a RadDock that has a DockCommand with OnClientCommand event attached, my script enters in a loop cycle.
Here you are a sample code that illustrates the behavior.
Just click on ShowHideRadDock1 to replicate the bug.
Thanks.
<script type="text/javascript"> |
function RadDockClientCommand(sender, eventArgs) { |
alert('RadDockClientCommand'); |
if (eventArgs.Command.get_name() == "Close") { |
var isClosed = sender.get_closed(); |
sender.set_closed(!isClosed); |
} |
} |
function ShowHideRadDock(controlID) { |
alert('In ShowHideRadDock'); |
var dock = $find('RadDock1'); |
var isClosed = dock.get_closed(); |
dock.set_closed(!isClosed); |
} |
</script> |
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true"> |
</telerik:RadScriptManager> |
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="javascript:ShowHideRadDock('RadDock1');">ShowHideRadDock1</asp:HyperLink> |
<br /> |
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="javascript:ShowHideRadDock('RadDock2');">ShowHideRadDock2</asp:HyperLink> |
<br /> |
<telerik:RadDockLayout ID="RadDockLayout1" runat="server"> |
<telerik:RadDock ID="RadDock1" runat="server" Skin="Telerik" Width="300px" Left="50px" |
CloseText="chiudi" BackColor="#a79c00" CssClass="RadDockPostIt"> |
<Commands> |
<telerik:DockCommand Name="Close" Text="Chiudi" OnClientCommand="RadDockClientCommand" |
CssClass="rdClose" /> |
</Commands> |
<ContentTemplate> |
My Content RadDock1 |
</ContentTemplate> |
</telerik:RadDock> |
<telerik:RadDock ID="RadDock2" runat="server" Skin="Telerik" Width="300px" Left="50px" |
Top="120px" CloseText="chiudi" BackColor="#a79c00"> |
<Commands> |
<telerik:DockCommand Name="Close" Text="Chiudi" OnClientCommand="RadDockClientCommand" |
CssClass="rdClose" /> |
</Commands> |
<ContentTemplate> |
My Content RadDock2 |
</ContentTemplate> |
</telerik:RadDock> |
</telerik:RadDockLayout> |
</form> |
</body> |