[CLOSED] Ext Object Reference

  1. #1

    [CLOSED] Ext Object Reference

    Is it possible to get a reference to Ext objects from any JavaScript?

    What I'd like to be able to do at the moment is call Reload() on an ext:Store from some JavaScript code completely outside of Coolite/Ext. The store in question has a static ID if that helps.

    I guess what I'm after is an Ext equivalent to document.getElementById of sorts.

    Regards,
    Ben
    Last edited by geoffrey.mcgill; Oct 01, 2010 at 9:18 PM. Reason: [CLOSED]
  2. #2

    RE: Ext Object Reference

    Hi Ben,

    All the controls/widgets instantiated by the Coolite Toolkit are instantiated and available on the client by referencing their client-side ID's.

    The following sample demonstates Expanding/Collapsing an <ext:Window> control with JavaScript "outside" of the control markup.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Window Expand/Collapse - Coolite Toolkit Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:Window ID="Window1" runat="server" Title="My Window" />
            
            <p><a href="#" &#111;nclick="Window1.expand()">Expand</a></p>
            
            <p><a href="#" &#111;nclick="Window1.collapse()">Collapse</a></p>
            
        </form>
    </body>
    </html>
    Hope this helps.



    Geoffrey McGill
    Founder
  3. #3

    RE: Ext Object Reference

    It does. That's great.

    What didn't help me when I tried it was calling .Reload() instead of .reload()!

    Thanks Geoffrey,
    Ben

Similar Threads

  1. Replies: 1
    Last Post: Jun 27, 2012, 9:19 PM
  2. [CLOSED] Null Reference Object Ajax
    By Oliver in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 01, 2012, 1:18 PM
  3. Replies: 1
    Last Post: May 03, 2010, 2:32 PM
  4. Replies: 4
    Last Post: Apr 12, 2010, 1:01 PM
  5. Replies: 0
    Last Post: Jun 03, 2009, 4:18 AM

Posting Permissions