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

RadWindow OnClientClose event causing postback of parent

1 Answer 151 Views
Window
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 23 Apr 2014, 07:03 PM
Prior to adding the OnClientClose event handler, closing the RadWindow did not cause a postback.  I added the following function to the RadWindow as the OnClientClose event handler, and now the parent window refreshes with a postback anytime the RadWindow is closed.  The event handler's purpose is to hide a the DropDownList of a RadComboBox within the RadWindow that isn't hidden properly if it's displayed and the user closes the RadWindow (The RadWindow closes, but the RadComboBox's DropDownList remains displayed until you click elsewhere on the page).  How can I prevent the postback?

There are no other Unload or Closing related events on the RadWindow.  Like I said, without the event handler for ClientClose, closing the RadWindow does not cause a postback of the parent window.  I didn't think hideDropDown() would cause a postback (at least, looking at its definition, it doesn't look like it should).

​function rwPOAOptionsDialog_ClientClose(sender, args) {
    $('#<%=luPatient.ClientID%>_cbLookup').hideDropDown();
}

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Apr 2014, 06:19 AM
Hi Trevor,

Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadWindow ID="radwinRefreshPage" runat="server" VisibleOnPageLoad="true"
    OnClientClose="HideDropDown">
    <ContentTemplate>
        <telerik:RadComboBox ID="radcboHideDropdown" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="Item1" />
                <telerik:RadComboBoxItem Text="Item2" />
            </Items>
        </telerik:RadComboBox>
    </ContentTemplate>
</telerik:RadWindow>

JavaScript:
<script type="text/javascript">
    function HideDropDown(sender, eventargs) {
        var combo = $find("<%=radcboHideDropdown.ClientID %>");
        combo.hideDropDown();
        __doPostBack();
    }
</script>

Thanks,
Shinu.
Tags
Window
Asked by
Trevor
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or