[CLOSED] Rendering butons on a row in a tab

  1. #1

    [CLOSED] Rendering butons on a row in a tab

    In the example I add buttons in a Tab of a TabPanel (taking data from an external class called pmappa). It's all dinamically built. The problem there is the buttons are shown in a column (one under the other) and not in a row. I tried to figure out how to change the layout but couldn't get it out.

    I also have one more question: is there a way to dynamically add event handlers to work at server side?

    Sorry if these things have been already discussed, but not having any documentation make things a bit difficult to me.

    protected void Render_pmappa(pmappa m)
    {
    Coolite.Ext.Web.TabPanel tabs = new Coolite.Ext.Web.TabPanel();
    tabs.ResizeTabs = true;
    tabs.MinTabWidth = Unit.Pixel(115);
    tabs.TabWidth = Unit.Pixel(135);
    tabs.EnableTabScroll = true;
    tabs.Width = Unit.Pixel(600);
    tabs.Height = Unit.Pixel(80);
    tabs.ActiveTab = 0;
    tabs.BodyBorder = false;
    tabs.Border = true;
    for (int i = 1; i <= m.mondi.Count; i++)
    {
    Coolite.Ext.Web.Tab tab = new Coolite.Ext.Web.Tab();
    tab.Title = m.mondi[i].nome;
    tab.IconCls = "tabs";
    tab.Closable = false;
    tab.BodyStyle = "padding: 6px;";
    foreach (ptipo pt in m.mondi[i].tipi.Values)
    {
    Coolite.Ext.Web.Button btn = new Coolite.Ext.Web.Button();
    btn.Text = pt.nome;
    btn.ToolTip = pt.descrizione;
    btn.Visible = true;
    tab.ContentControls.Add(btn); 
    tab.Frame = false;
    bool b = tab.HasLayout(); 
    }
    tabs.Tabs.Add(tab);
    }
    this.PlaceHolder1.Controls.Add(tabs);
    }
  2. #2

    RE: [CLOSED] Rendering butons on a row in a tab

    Solved myself this way:

    I Added a TableLayout to each Tab
    On each TabLayout I added the different Buttons (in the Cells of the TableLayout)
    I enabled TabPanel.LayoutOnTabChange to ensure visual update when Tab is changed

    hope this is the correct way to do it.
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 2:45 AM.
  3. #3

    RE: [CLOSED] Rendering butons on a row in a tab



    The <ext:TableLayout> is a perfect solution.

    Unfortunately the <ext:Button> is currently rendered as a "block" level element which is what's forcing them into individual rows when they're just rendered straight onto the Page (or controls collection).

    Using a <table> and tweaking the css would work, although using an <ext:TableLayout> is the best solution.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] IE 7 rendering of combobox
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Feb 21, 2012, 1:25 PM
  2. [CLOSED] Why is this not rendering?
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 14, 2010, 6:01 PM
  3. [CLOSED] [1.0] MVC and Rendering
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 25, 2010, 1:39 PM
  4. [CLOSED] Rendering Tab
    By gokcemutlu in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 17, 2009, 6:37 AM
  5. [CLOSED] MenuPanel rendering bug in IE7
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 10, 2009, 11:01 AM

Posting Permissions