PDA

View Full Version : problem with open Panel with layout "accordion" with method "setActiveItem"



TAG
9 Sep 2009, 1:14 AM
Hello,
I have a resize Object, and I associate a event on Object which this code:


...//object resize
var appi=new Ext.Resizable('idOggetto', {
wrap:true,
pinned:false,
handles: 'all',
draggable:true,
dynamic:true
});
...//the code on associate event on resize object
Ext.get('idOggetto').on('click',function(){attivaPanel(accordionPanel,'idPanelObject');});


this code activates the panel when you click on the object.
I have a panel which "layout:'accordion'".
My code active Panel, but the Panel is close, and for open this I click on the "+" top right.
I read the Api doc(for Ext.layout.AccordionLayout) and I see the public method : setActiveItem( String/Number item ) which sets the active (expanded) item in the layout.
I use this:


var attivaPanel=function(nomePannello,id){//nomePannello which have
//layout:accordion
var pannello=nomePannello.get(id);//id is of Panel which I open
nomePannello.setActiveItem(id);
pannello.show();
}


but this code don't run correctly.
if I remove "nomePannello.setActiveItem(id);" I show panel but this don't open, if I insert "nomePannello.setActiveItem(id);", the panel don't show neither open or closed.
I have test:
"nomePannello.setActiveItem(pannello);" and "nomePannello.setActiveItem(pannello.id);"
but haven't good result.

anyone knows give me advice?