[CLOSED] creating tabStrip in javascript

  1. #1

    [CLOSED] creating tabStrip in javascript

    Hi
    I wish create a tabStrip in the javascript. But when the page is render, I get this error:

    Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class : Ext.net.TabStrip

    I'm trying with this sample code:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>TabStrip and TabStripItem - Ext.NET Examples</title>
        
        <script type="text/javascript" >
            Ext.onReady(function () {
                Ext.create("Ext.net.TabStrip", {
                    id: "TabStrip1",
                    renderTo: "App.TabStrip1_Container",
                    items: [{
                        actionItem: "elm1",
                        text: "Summary"
                    }, {
                        actionItem: "elm2",
                        text: "Data"
                    }],
                    activeTab: 0
                });
            });
        </script>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <div id="elm1" style="padding:5px;">Summary</div>
            <div id="elm2" style="padding:5px;">Data</div>
    
        </form>
    </body>
    </html>
    Last edited by Daniil; May 10, 2012 at 6:19 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please add:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!X.IsAjaxRequest)
        {
            ResourceManager.RegisterControlResources<TabStrip>();
        }
    }
    and replace
    renderTo: "App.TabStrip1_Container",
    with
    renderTo: Ext.getBody(),
    as there is no "App.TabStrip1_Container" on your page.
  3. #3
    Hi Daniil!

    Works very fine!

    Thanks a lot!

Similar Threads

  1. Replies: 5
    Last Post: Jun 22, 2012, 2:47 PM
  2. Replies: 3
    Last Post: May 31, 2012, 6:02 PM
  3. [CLOSED] ext:Window: Creating in JavaScript
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 04, 2012, 4:34 PM
  4. Replies: 6
    Last Post: Oct 13, 2011, 11:55 AM
  5. [CLOSED] Creating a c# component that generates a JavaScript class
    By PLoch in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Aug 04, 2011, 5:11 PM

Posting Permissions