PDA

View Full Version : how to hide a tabpanel without to destroy it??



diego_83
30 Jan 2008, 8:15 AM
hi everybody.

i am trying to change form 1.1 to 2.0 and i have a little problem.

i add a listener to a tabpanel and it reports me an error .

this is the code and i think, i am accessing wrong to the element.
tabs.findById(iframejid).on('beforedestroy', function(tab){
alert('dentro de la funcion ');
});

thanks in advance :)

paubach
30 Jan 2008, 8:22 AM
Hi Diego.
Use hideTabStripItem(ID);

Look for TabPanel there: http://extjs.com/deploy/dev/docs/

Pau

diego_83
30 Jan 2008, 8:48 AM
hi .

the problem is not to hide or to show.

the problem is in the line:
tabs.findById(iframejid).on('beforedestroy', function(tab){

this line reports me an error and i don

para
30 Jan 2008, 9:07 AM
Use Firebug, put a breakpoint at that line.
Use the 'Watch' variables and put different things in, such as


tabs
iframejid
tabs.findById(iframejid)

and see what each of them is. You may not have the correct ID. If what you have is a tab index, use


tabs.items.getAt(iframejid);

paubach
30 Jan 2008, 9:36 AM
Veamos, osea, lets see...

try with: tabs.getComponent(iframejid), tabs.getItem(iframejid)

but don't understand why doesn't work with findById.

Also try just this without the ".on('beforedestroy', function(tab){..." adding an .getId(). All inside an alert to see if the problem is in the access or with the function. You know, divide and conquer!!

Pau

para
30 Jan 2008, 9:42 AM
If the ID is not explicitly specified, it will be something like 'ext-comp-1019'. I'm going on the assumption that he has an index, not an ID.

Firebug cures all of this.

diego_83
31 Jan 2008, 12:46 AM
i ve tryed all things that you writted and the error continues appearing.

i think the error is in the parameter of the function, but i don

paubach
31 Jan 2008, 1:53 AM
Try changing

tabs.findById(iframejid).on('beforedestroy', function(tab){
alert('dentro de la funcion ');
});

for


alert(tabs.findById(iframejid).getId());

diego_83
1 Feb 2008, 1:09 AM
i ve tried everything that you post and it doesn

paubach
1 Feb 2008, 1:46 AM
It's not to work... it's just to know if the problem is with selection or not...

diego_83
1 Feb 2008, 3:22 AM
i think you are rigth,

i think problem is in selection of element inside function because the error always is the same,

it is something like the elemente that is inside function hasn

paubach
1 Feb 2008, 3:52 AM
Whats the result of the alert