adding tabs dynamically

  1. #1

    adding tabs dynamically

    I am using following javascript to add tabs dynamically. It is working perfectly except the icon. icon is not appearibg.

    can you give me some clue to resolve this ...

    function addTab(tabPanel, id, url,title) {
                var tab = tabPanel.getComponent(id);
                if (!tab) {
                    tab = tabPanel.add({ 
                        id: id, 
                        title: title, 
                        width: 100,
                        iconCls: 'ChartOrganisation',
                        autoLoad: {
                            showMask: true,
                            url: url,
                            maskMsg: 'Loading ...'
  2. #2

    RE: adding tabs dynamically


    Just ensure that css class has been added to your page. You need to manually define the css class for the icon.

    Hope this helps.

    Geoffrey McGill
  3. #3

    RE: adding tabs dynamically

    Thanks for pointing it out, I missed the css

    .tab {
                    background-image: url(img/tab.png);
                    background-repeat: no-repeat;
                    background-position: center left;
  4. #4

    RE: adding tabs dynamically


    I am trying to add the custom attribute as "IconClsName" which can be assinged later to the tab iconcls property through java script. But the page throwing java script error.

    Line: 237
    Char: 3717
    URL : http://localhost:2388/BizHRWebSite/L.....Default.aspx

    I have created a user control with TreePanel and Implemented code which is given Coolite Example site as a static menu from site map. To use icon to the dynamic tab, which is assigned to the node i am trying to add a custom attribute to the node as follows. But it is not working.

        ConfigItem cI = new ConfigItem("IconClsName", "icon-" + siteMapNode["Icon"].ToLower());
    Note: treepanel already registering the relavant icon on client-side on the page. I have verified the details from View Source of the my browser. (IE 6).

    Any help is appreciated.


Similar Threads

  1. Adding 2 idetical tabs on the same TabPanel
    By ozayExt in forum 1.x Help
    Replies: 5
    Last Post: Aug 22, 2011, 6:12 PM
  2. Replies: 0
    Last Post: Dec 29, 2010, 11:36 PM
  3. Adding Tabs With OnActivate Listener
    By juan_pablo in forum 1.x Help
    Replies: 4
    Last Post: Apr 25, 2010, 4:28 PM
  4. Replies: 0
    Last Post: Apr 09, 2009, 5:49 PM
  5. Adding textfields to tabs
    By sz_146 in forum 1.x Help
    Replies: 0
    Last Post: Nov 13, 2008, 11:35 AM

Posting Permissions