PDA

View Full Version : Problem hide/display radioButton



marxan
5 Jul 2010, 1:45 AM
Hello,

I have a strange problem: I want to display or hide a radio button when clicking on another radio button.

I want these Rbtn first hidden. And here is my problem. I use "hidden: true", to hide it. and then through a function I
retrieve the ID of the button and try to display it.

var el = Ext.get('b-LFV');
var label = el.next('label');
el.setVisible(true);
label.setVisible(true);

This code doesn't work. However if I don't hide the RBtn and I do:

el.setVisible(false);
label.setVisible(false);

The field is hidden...

Does anyone knows what could be the problem?

Thanks.

Marxan

Condor
5 Jul 2010, 2:55 AM
Use:

Ext.getCmp('id-of-radio').hide();

ps. You probably want to enable label tracking, so you don't need to hide labels separately:

Ext.layout.FormLayout.prototype.trackLabels = true;

marxan
5 Jul 2010, 7:00 AM
Thanks,

It works, but I don't know how to do to display the radiobtn avec I've hidden it.
In other words: when I click on a radio button it displays another group of radio button.
But if I want to select another rBtn it should display the new group and hide the previous one.

Another question: is it possible to define the position on the screen of a radio button (it is linked with my previous question as I want to display the group in the same place on the screen.

Many thanks in avance, I'm stuck on that matter since this morning!

Marxan