Results 1 to 2 of 2

Thread: tabs go crazy

  1. #1

    Default tabs go crazy

    Hi all ,
    There is some problem with the tabs that i cannot explain , when clicking and closing the tabs and opening them again ,
    i see that the content from tab1 goes also into tab2 .

    my code

    Code:
    Ext.EventManager.addListener("supplier_tree", 'click', function(){
    	
    	 var json2 = [
            {"text" : "Supplier Management", "id" : 100, "leaf" : false, "cls" : "folder", "children" : [
                {"text" : "add supplier", "id" : 1000, "leaf" : true, "cls" : "folder"
                },
                {"text" : "supplier overview", "id" : 2000, "leaf" : true, "cls" : "folder"
                },
            ]}
        ];    
        if (!Ext.get('static_supplier_menu')) {
    		var tree2 = new Ext.tree.TreePanel({
    			id:'static_supplier_menu',
    			animate: true,
    			enableDD: false,
    			loader: new Ext.tree.TreeLoader(), // Note: no dataurl, register a TreeLoader to make use of createNode()
    			lines: false,
    			border:false,
    			renderTo: 'supplier_tree_div',
    			root: new Ext.tree.AsyncTreeNode({
    				text: 'Suppliers',
    				draggable: false,
    				id: 'source',
    				children: json2
    			}),
    			rootVisible: true,
    		});
    		tree2.on("click", function(node, e) {  
    		   alert(node.id );
    		   switch (node.id)
    		   {
    		   	case 1000:
    			if (Ext.getCmp('apptabs').findById('number_management_id') &&
    			Ext.getCmp('apptabs').findById('number_management_id').isVisible()) {
    					Ext.getCmp('apptabs').setActiveTab('number_management_id');
    			
    					return;
    			}
    			else {
    			
    				Ext.getCmp('apptabs').add({
    					layout: 'form',
    					resizable: true,
    					closable: true,
    					id: 'number_management_id',
    					title: 'Supplier management',
    					items: [saveSuppliers]
    				});
    				Ext.getCmp('apptabs').setActiveTab('number_management_id');
    				//Ext.getCmp('apptabs').findById('number_management_id').load({url:"providers.php",scripts: true});
    				Ext.getCmp('apptabs').findById('number_management_id').doLayout();
    			}
    			break;
    			/* grid supplier */
    			case 2000:
    			if (Ext.getCmp('apptabs').findById('supplier_management_grid') &&
    			Ext.getCmp('apptabs').findById('supplier_management_grid').isVisible()) {
    					Ext.getCmp('apptabs').setActiveTab('supplier_management_grid');
    			
    					return;
    			}
    			else {
    			
    				Ext.getCmp('apptabs').add({
    					layout: 'fit',
    					resizable: true,
    					closable: true,
    					id: 'supplier_management_grid',
    					title: 'Supplier overview',
    					items: new ProvidersGrid()
    				});
    				Ext.getCmp('apptabs').setActiveTab('supplier_management_grid');
    				Ext.getCmp('apptabs').findById('supplier_management_grid').doLayout();
    			}
    			break;
    			
    			
    		   }
    		                  });
    	}else return;
    
    }, this, { preventDefault: true } );

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Closing a tab and then opening again? Again?

    This came up yesterday!

Posting Permissions

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