سؤال

I have a RadWindow as following:

<telerik:RadWindow ID="PIQRadWindow" Modal="true" runat="server" Skin="Default" Behaviors="Close,Move" CssClass="RadWindowCustomClass" VisibleStatusbar="false" width="400px" OnClientClose="RadWindowClose">
    <ContentTemplate>
    <pd:uc_PopupDropdown ID="pdPIQScore" enableviewstate="False" Draggable="true" isInternal="true" ISOC="ProjectInstructionQuality" DivContent = "pdPIQScore" ScriptPrefix = "OFS_" runat="server" />  
    </ContentTemplate>     
    </telerik:RadWindow>

I want it to be closed within a onclick event I defined. I tried to use

   function getRadWindow() {
      var oWindow = null;
      if (window.radWindow) oWindow = window.radWindow;
      else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
      return oWindow;
   }

   function clientClose() {   
      getRadWindow().close();
   }

But it's not working for me. Error message: "window.frameElement is null".

Anyone has ideas?

هل كانت مفيدة؟

المحلول

You must use $find() when using the ContentTemplate. You can either keep a reference in a global JS variable (you can populate the variable in Sys.Application.Load), or create functions that will open and close the dialog and call them whenever needed. Check this demo's code: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx.

نصائح أخرى

Have you checked out this post? If so, please share some more of your code so we can see exactly whats going on. How to close the radwindow on serverside and refresh the parent page

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top