PDA

View Full Version : basic tab panel



cwolves
13 Jul 2007, 10:06 AM
I have a tab panel that is very basic and not working. The tabs are unclickable and the activate() call activates the wrong tab. Help?


function init(){
var DH = Ext.DomHelper;

this.div = DH.append(document.body, {});

this.tabPanel = new Ext.TabPanel(this.div, {
resizeTabs : true ,
minTabWidth : 20 ,
preferredTabWidth : 150
});

this.uploadTab = this.tabPanel.addTab(this.uploadContent = DH.append(this.div, {}), 'Upload File' , 'test 1');
this.normalizeTab = this.tabPanel.addTab(this.normalizeContent = DH.append(this.div, {}), 'Normalize Data', 'test 2');
this.JoinTablesTab = this.tabPanel.addTab(this.joinTablesContent = DH.append(this.div, {}), 'Join Tables' , 'test 3');
this.runImportTab = this.tabPanel.addTab(this.runImportContent = DH.append(this.div, {}), 'Run Import' , 'test 4');

this.tabPanel.activate(this.uploadContent);
}

init();

tryanDLS
13 Jul 2007, 10:12 AM
Did you look at the rendered HTML in firebug - does it look like it built everything?

cwolves
13 Jul 2007, 10:13 AM
Yep, everything is there. And if I call activate() on the 1st tab after I create the 2nd tab, the 2nd one will be activated.

Basically it looks like all the tabs reference the same object when this code is done.

cwolves
13 Jul 2007, 10:22 AM
Figured it out, moving to bugs forum.