EXT.NET v3.0 BETA RELEASED!
Now with Tablet Support!
Ext.NET v3.0 Beta is here with lots of new cool features and now with tablet support! Check Examples Explorer now to see it in action or download and test it yourself for free!
Results 1 to 2 of 2

Thread: Creating Accordion Layout Menu dynamically from AjaxStoreResult

  1. #1
    Member
    Join Date
    Sep 2010
    Posts
    105

    Creating Accordion Layout Menu dynamically from AjaxStoreResult

    Hi All is there any way to create accordion layout dynamically from AjaxStoreResult.
    As WestMenu in ext.net MVC example is hardcorded.

  2. #2
    Member
    Join Date
    Sep 2010
    Posts
    105
    Master page is like this

    <code>
    <West Split="true" CollapseMode="Default" Collapsible="true" MaxWidth="200" MarginsSummary="0 0 4 4">
    <ext:Panel ID="Panel2" runat="server" Title="Navigation" Width="225">
    <Content>
    <%= ViewData["Menu"] %>
    </Content>
    <DirectEvents>
    <BeforeRender Url="/Data/CreatMenu" />
    </DirectEvents>
    </ext:Panel>
    </West>
    </code>

    In Action am doing this
    <code>
    TreePanel tree = new TreePanel();

    tree.Title = "Online Users";
    tree.RootVisible = false;


    Ext.Net.TreeNode root = new Ext.Net.TreeNode();
    root.NodeID = "root";

    tree.Root.Add(root);

    Ext.Net.TreeNode node1 = new Ext.Net.TreeNode();

    node1.Text = "Friends";
    node1.Expanded = true;

    node1.Nodes.Add(new Ext.Net.TreeNode("Jack", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Brian", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Jon", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Tim", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Nige", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Fred", Icon.User));
    node1.Nodes.Add(new Ext.Net.TreeNode("Bob", Icon.User));

    root.Nodes.Add(node1);

    Ext.Net.TreeNode node2 = new Ext.Net.TreeNode();
    node2.Text = "Family";
    node2.Expanded = true;

    node2.Nodes.Add(new Ext.Net.TreeNode("Kelly", Icon.UserFemale));
    node2.Nodes.Add(new Ext.Net.TreeNode("Sara", Icon.UserFemale));
    node2.Nodes.Add(new Ext.Net.TreeNode("Zack", Icon.UserGreen));
    node2.Nodes.Add(new Ext.Net.TreeNode("John", Icon.UserGreen));

    root.Nodes.Add(node2);

    Ext.Net.Panel panel1 = new Ext.Net.Panel("Settings");
    Ext.Net.Panel panel2 = new Ext.Net.Panel("Even More Stuff");
    Ext.Net.Panel panel3 = new Ext.Net.Panel("My Stuff");

    Toolbar toolbar = new Toolbar();

    Ext.Net.Button button1 = new Ext.Net.Button();
    button1.Icon = Icon.Connect;

    ToolTip tooltip = new ToolTip();
    tooltip.Title = "Rich ToolTips";
    tooltip.Html = "Let your users know what they can do!";

    button1.ToolTips.Add(tooltip);

    Ext.Net.Button button2 = new Ext.Net.Button();
    button2.Icon = Icon.UserAdd;

    Ext.Net.Button button3 = new Ext.Net.Button();
    button3.Icon = Icon.UserDelete;

    toolbar.Items.Add(button1);
    toolbar.Items.Add(button2);
    toolbar.Items.Add(button3);

    Window window = new Window();

    window.Title = "Accordion Window";
    window.Width = Unit.Pixel(250);
    window.Height = Unit.Pixel(400);
    window.Maximizable = true;
    window.Icon = Icon.ApplicationTileVertical;
    window.BodyBorder = false;
    window.Layout = "Accordion";

    window.TopBar.Add(toolbar);

    window.Items.Add(tree);
    window.Items.Add(panel1);
    window.Items.Add(panel2);
    window.Items.Add(panel3);

    StringBuilder sb = new StringBuilder();
    StringWriter tw = new StringWriter(sb);
    HtmlTextWriter hw = new HtmlTextWriter(tw);

    window.RenderControl(hw); // This is giving false code
    ViewData["Menu"] = sb;

    return sb.ToString();

    </code>

    Is there anyway to get control innerhtml?

Similar Threads

  1. Replies: 8
    Last Post: Jul 29, 2012, 11:58 AM
  2. Replies: 0
    Last Post: Mar 27, 2012, 11:01 AM
  3. [CLOSED] problem creating accordion Dynamically
    By SymSure in forum 1.x Premium Help
    Replies: 7
    Last Post: Apr 08, 2011, 11:35 PM
  4. Accordion layout
    By Elie.fakhry in forum 1.x Help
    Replies: 1
    Last Post: Oct 12, 2010, 9:53 PM
  5. [CLOSED] accordion menu in codebehind
    By vali1993 in forum 1.x Premium Help
    Replies: 3
    Last Post: Mar 29, 2010, 6:34 PM

Tags for this Thread

Posting Permissions