Create new Window with Callback function

  1. #1

    Create new Window with Callback function

    I want to open new Window and pass a callback function as parameter, and when close Window, it will invoke that callback.
    Thank for help? :x
  2. #2
    Quote Originally Posted by vucuongkg View Post
    I want to open new Window and pass a callback function as parameter, and when close Window, it will invoke that callback.
    Thank for help? :x
    It would be best to start us off with a simplified .aspx sample demonstrating as much of the scenario as possible. Please post inside [CODE] tags.

    The Window Component includes a <Close> DirectEvent/Listener Handler that you should be able to tap into for running code during that event.
    Geoffrey McGill
    Founder
  3. #3
    I have three pages: Default.aspx, AddOrEdit.aspx and List.aspx.


    Click image for larger version. 

Name:	19-Apr-12 2-21-30 PM.jpg 
Views:	152 
Size:	101.0 KB 
ID:	4135

    Click image for larger version. 

Name:	19-Apr-12 2-32-21 PM.jpg 
Views:	92 
Size:	100.2 KB 
ID:	4136

    Default page


    Default.aspx: I have a Window control
    
    
      <script language="javascript"> 
      var loadWindow = function (url, title, width, height) {             Ext.net.DirectMethods.ShowWindow(url, title, width, height);         }
    
        </script> 
    
    
       <ext:Window ID="wdCommon" runat="server" Icon="ApplicationViewGallery" Title="ASP.NET Button with Custom DirectEvent"         AutoScroll="true" BodyStyle="background-color:#fff;" Draggable="false" Resizable="false"         Hidden="true" MaskDisabled="false">         <AutoLoad MaskMsg="Đang nạp dữ liệu..." ShowMask="true">        
     </AutoLoad>      
       <Listeners>          
       <BeforeShow Fn="fitWindow" />       
      </Listeners>   
          <Buttons>            
     <ext:Button ID="Button1" runat="server" Icon="ArrowUndo" Text="Đóng">                 
    <Listeners>                   
      <Click Handler="wdCommon.hide();" />               
      </Listeners>            
    </ext:Button>       
      </Buttons>    
     </ext:Window>

    Default.aspx.cs


    
    
        [DirectMethod]    
     public void ShowWindow(string url, string title, int width, int height)   
      {         wdCommon.AutoLoad.Url = url;     
        wdCommon.Title = title;      
       wdCommon.Width = width;    
         wdCommon.Height = height;      
       //wdCommon.        
     wdCommon.AutoLoad.Mode = LoadMode.IFrame;    
         wdCommon.Render(this.Form);       
      wdCommon.Show();       }
    Last edited by vucuongkg; Apr 19, 2012 at 9:52 AM.
  4. #4
    I find this post: http://forums.ext.net/showthread.php...rom-ext-window but It have no solution attach here. Can someone give me a guide? thanks alot!

Similar Threads

  1. Create new window dynamically on button click from another window
    By softlabsgroup.support in forum 1.x Help
    Replies: 6
    Last Post: May 01, 2012, 9:26 AM
  2. Replies: 6
    Last Post: Feb 15, 2012, 4:15 PM
  3. Replies: 2
    Last Post: Jul 27, 2010, 11:50 AM
  4. ajax request failure callback function help
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Apr 30, 2010, 9:52 AM
  5. Replies: 1
    Last Post: Jul 23, 2009, 3:57 AM

Tags for this Thread

Posting Permissions