Results 1 to 2 of 2

Thread: Simple code result in orphan id? (code,html,jpg attached)

  1. #1
    Sencha User
    Join Date
    Sep 2007
    Posts
    11

    Default Simple code result in orphan id? (code,html,jpg attached)

    I shrink my large number code for check memory leak, but at last, I found even the simplest code result in orphan id, could you help me?
    I create a formpanel in a tabpanel, and tabpanel in a viewport.
    Checking with sIEve, the form created everytime will be orphaned.



    test1.js:

    Code:
    function init() {
    	var uptab = new Ext.TabPanel({
    				id : 'uptab',
    				autoDestroy : true,
    				enableTabScroll : true,
    				layoutOnTabChange : true,
    				listeners : {},
    				defaults : {},
    				activeTab : 0,
    				items : []
    			});
    			
    	var gid = 0;
    
    	var tool = new Ext.Toolbar({
    				id : 'tool',
    				border : false,
    				items : [{
    							text : 'Toggle Me',
    							xtype : 'button',
    							handler : function() {
    								gid = gid+1;
    								uptab.add(new Ext.FormPanel({
    											id : 'orphan_form_'+gid,
    											title : 'host',
    											closable : true
    										})).show();
    							}
    						}]
    			});
    
    	var viewport = new Ext.Viewport({
    				layout : 'border',
    				id : 'viewport',
    				hideBorders : true,
    				items : [new Ext.Panel({
    									bodyBorder : false,
    									border : false,
    									layout : 'fit',
    									region : 'north',
    									cls : 'docs-header',
    									height : 26,
    									items : tool
    								}), {
    							region : 'center',
    							layout : 'border',
    							hideBorders : true,
    							items : [{
    										region : 'center',
    										contentEl : 'uptabs',
    										layout : 'fit',
    										margins : '0 5 0 0',
    										height : 700,
    										items : uptab
    									}]
    						}]
    			});
    }

    HTML Code:
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
    
    <!-- GC -->
    <!-- LIBS -->
    <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
    <!-- ENDLIBS -->
    
    <script type="text/javascript" src="../../ext-all.js"></script>
    <script type="text/javascript" src="./test1.js"></script>
    
    </head>
    <body>
    <script type="text/javascript">
            Ext.onReady(init);
    </script>
    <body>
    <div id="north" />
    <div id="west" />
    <div id="uptabs"></div>
    <div id="downtabs" />
    </body>
    </html>

    Attachment 16227

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    11

    Default

    could some one give me some clue where to free form id nested in viewport?
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •