PDA

View Full Version : loading mxgraph in tab panel when the tab panel is clicked



kavyakn
26 Mar 2012, 2:22 AM
I need to load mxgraph in a tab panel whenever i click that particular tab. Currently, mxgraph code is in a js file and is wriiten inside a method called main( container) . Container will take the id of the tab panel to which the graph should be loaded. i have added the listener to tge tab panel like this::

tabPanel.add({
xtype : 'panel'
,id : fvId.topologyTab
,title : 'Topology'
,width : fvConstants.tabPanelWidth
,height: fvConstants.tabPanelHeight,
listeners: {
onClick: function(){
console.log("callling main");
main(fvId.topologyTab);
}
}
});
but the mx graph is not being rendered to the tab panel on clicking the tab. Could you please tell me what might be the issue?

mitchellsimoens
26 Mar 2012, 8:01 AM
It uses a global function called main? Horrible idea.

is onClick firing?

mankz
26 Mar 2012, 8:36 AM
Try using 'activate' instead of onClick (no event with that name)