Results 1 to 6 of 6

Thread: load multiple tabs in one click

  1. #1

    Question load multiple tabs in one click

    Hi

    my question is : is it possible to load multiple tabs in just one click ?

    this is my code :

    in sample.js
    Code:
    desktop.mj = Ext.extend(Ext.app.Module, {
    	id : 'mj-win',
    	init : function() {
    		this.launcher = {
    			text : 'test',
    			iconCls : 'icon-grid',
    			handler : this.createWindow,
    			scope : this
    		}
    	},
    	createWindow : window.createMj
    });
    window constructor
    Code:
    function createMj() {
    	var desktop = this.app.getDesktop();
    	var win = desktop.getWindow('mj-win');
    	
    	// create tree
    	tree = new Ext.tree.TreePanel( {
    		animate : true,
    		enableDD : true,
    		containerScroll : true,
    		region : 'west',
    		margins : '3 0 3 3',
    		cmargins : '3 3 3 3'
    	});
    
    	root = new Ext.tree.TreeNode({text : 'Semua', allowDrag : false, allowDrop : false});
    	root.addListener("click", testLoad, this);
    	tree.setRootNode(root);
    	
    	// create tab panel
    	pan = new Ext.TabPanel( {
    		defaults:{autoScroll:true},
    		region : 'center',
    		activeTab : 0,
            items : [{
    		    title: 'tab 1',
    		    items: mainPanel = new Ext.Panel({
        			    autoScroll : true,
    				margins : '3 3 3 0'
    			})
    		},{
    		    title: 'tab 2',
    		    items: detPanel = new Ext.Panel({
    		    	autoScroll : true,
    		    	margins : '3 3 3 0',
    		    })
    		}]
    	})
    
    	if (!win) {
    		win = desktop.createWindow( {
    			id : 'mj-win',
    			width : 860,
    			height : 500,
    			layout : 'border',
    			items : [tree, pan]
    		});
    	}
    	win.show();
    }
    function for load panel
    Code:
    function testLoad() {
    	mainPanel.load({url : 'pages/mnj/Project.htm'});
    	detPanel.load({url : 'pages/mnj/Detail.htm'});
    }
    and the result is error : this.body has no properties

    i also try to use listeners in second tab : listeners: {activate: loadDetail}:

    functions for listeners :
    Code:
    function loadDetail() {
    	detPanel.load({url : 'pages/mnj/detail.htm'});
    }
    and the result is error : detPanel has no properties

    im confused... please help me thx

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    Please post your code in CODE tags so others can read it. It sounds like you have a scope issue. Have you stepped thru your code with Firebug?

  3. #3

    Default

    yes, I've try to use firebug and change ext-all.js with ext-all-debug.js and gave an error in this line (maybe) : var um = this.body.getUpdater();

    what is this mean ?

  4. #4
    Sencha User
    Join Date
    Jul 2007
    Location
    Italy
    Posts
    134

    Default

    Same error here when I use the load() method of a panel

  5. #5

    Default

    looking at the above code, it is unclear where 'testLoad' is running from, leading me to believe that there are scoping issues.
    fermo, post some code, we cant read your mind.

  6. #6
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    I hope all of this is wrapped in an Ext.onReady block ?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


Posting Permissions

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