Issues with dynamic IDs and tab panels

  1. #1

    Issues with dynamic IDs and tab panels

    I have the following Javascript code to open a new tab in a TabPanel when a node on a TreePanel is selected:

        <script type="text/javascript">
            //<![CDATA[
            var addTab = function(tabPanel, id, name, icon, url) {
                var tab = tabPanel.getComponent(id);
                if (!tab) {
                    tab = tabPanel.add({
                        id: id,
                        title: name,
                        closable: true,
                        border: false,
                        iconCls: icon,
                        autoLoad: {
                            showMask: true,
                            scripts: true,
                            mode: 'merge',
                            url: url,
                            maskMsg: 'Loading ' + name + '...'
                        }
                    });
                }
                tabPanel.setActiveTab(tab);
            }
            //]]
        </script>
    The following code returns javascript errors:

    <ext:TreeNode NodeID="ExampleNode" Text="Example" Icon="House" Expanded="true">
    <Listeners>
       <Click Handler='addTab(#{CenterTabPanel}, "ExampleTab", "Example", "icon-house", "/Example");' />
    </Listeners>
    <Nodes>
    when my tab panel is coded as follows:

    <ext:TabPanel ID="CenterTabPanel" EnableTabScroll="true" runat="server">
    </ext:TabPanel>

    However it works fine when I have the following:

    
    <ext:TreeNode NodeID="ExampleNode" Text="Example" Icon="House" Expanded="true">
    
    <Listeners>
    
       <Click Handler='addTab(CenterTabPanel, "ExampleTab", "Example", "icon-house", "/Example");' />
    
    </Listeners>
    
    <Nodes>


    
    <ext:TabPanel ID="CenterTabPanel" IDMode="Static" EnableTabScroll="true" runat="server">
    
    </ext:TabPanel>
    (had to set the IDMode to static)

    Note that I am using ASP.NET MVC and have the latest code committed to the SVN repository. Any help would be greatly appreciated.
  2. #2

    RE: Issues with dynamic IDs and tab panels

    Hi mindcore1,

    I've confirmed the Token parser is not correctly parsing tokens in a TreeNode Listener. With my initial debug attempt I wasn't able to isolate the exact problem, but we should be able to get this working soon and commit to SVN.


    Unfortunately, if we do add this functionality, I don't think it will get included with public release of v0.7, but it should be available in the future v0.8. release, which should then include the TreeNode token parsing.*


    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 3
    Last Post: Mar 08, 2012, 4:00 PM
  2. Replies: 11
    Last Post: Aug 11, 2011, 11:07 AM
  3. Bug with dynamic Add/Remove of panels
    By decho in forum 1.x Help
    Replies: 7
    Last Post: Aug 10, 2011, 10:16 AM
  4. [CLOSED] Height Issues when auto loading panels
    By craig2005 in forum 1.x Legacy Premium Help
    Replies: 19
    Last Post: Mar 21, 2011, 7:04 PM
  5. [CLOSED] Need Help with Performance Issues - Grid Panels
    By JD in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Dec 31, 2009, 5:56 AM

Posting Permissions