PDA

View Full Version : Tabpanel problem with Viewport tabs



Cloetn
19 Feb 2011, 8:01 AM
Situaties:
I have 2 links in my tree view. Both should open a new Tab in my tabpanel but only one of them does.

This is my listener of the treeview:


listeners: {
click: function (n) {
switch (n.attributes.text){
case "View Engineers":
var contentTab = Ext.getCmp('tpContent');
if (contentTab.findById(n.attributes.text)){
contentTab.setActiveTab(n.attributes.text);
}else{
contentTab.add({
id: n.attributes.text,
xtype: 'engineersfull',
title: n.attributes.text,
closable: true
});
contentTab.setActiveTab(n.attributes.text);
}

break;
case "View Tickets":
var contentTab = Ext.getCmp('tpContent');
if (contentTab.findById(n.attributes.text)){
contentTab.setActiveTab(n.attributes.text);
}else{
contentTab.add({
id: n.attributes.text,
xtype: 'ticketdetail',
title: n.attributes.text,
closable: true
});
contentTab.setActiveTab(n.attributes.text);
}
break;
}
}
}

Only the EngineerFull page opens , the ticketdetail one gives me this error:

Node cannot be inserted at the specified point in the hierarchy" code: "3

Here is the both of the 2 tabs:

http://i.imgur.com/BN91O.png

Can't see to find the problem here , what I'm doing wrong?

Thanks

Cloetn
19 Feb 2011, 10:48 AM
Solved it ,

It seems you can't put multiple ViewPorts in a already existing Viewport, strangely it worked for 1 but once I switched to a new one it crashed.

I changed the 'EngineerFull' & TicketDetail' to Panel and everything seems 2 work.