PDA

View Full Version : change fieldset parameters



bauchinj
16 Dec 2009, 6:48 AM
Hello!

I'd like to show and hide checkbox of fieldset and change same time the title of the fieldset:


if(mode == 'new'){
alert(mode+Ext.getCmp('password').title);
Ext.getCmp('password').title = '';
Ext.getCmp('password').checkboxToggle = false;
alert(mode+": "+Ext.getCmp('password').title);
}
else{
alert(mode+Ext.getCmp('password').title);
Ext.getCmp('password').title = 'password - title';
Ext.getCmp('password').checkboxToggle = true;
alert(mode+": "+Ext.getCmp('password').title);
}


After this source, I update the output:


container.doLayout();


So far, the problem is, that the output isn't updated, value is changed, I can see from the alert, but the output don't change like it shold - it do nothing!
Do anybody have an idea?

CrazyEnigma
16 Dec 2009, 7:43 AM
You have to remember that when EXT JS renders the dom that it not only adds functionality to it, but altering the dom is the last thing that you should be doing. The config at this time is useless. There are exposed public properties that you may used, but the best way to access and change information is through the methods.

There is a setTitle method on the object.

bauchinj
16 Dec 2009, 10:51 PM
OK, is it possible to change a whole item? fieldset is one item of xtype:'form'! So I mean, to change just fieldset to textfield or another fieldset (can I work with variables)?

CrazyEnigma
17 Dec 2009, 6:52 AM
What exactly do you mean? I don't understand your question. Do you mean to say you want to change a fieldset to a combobox? fieldset is of xtype: 'fieldset', and these should reside in a form. This is not possible. Or do you mean to say that you want to dynamically add fieldsets and other components to your form. That is always doable.

Use <your form panel>.add(<your config>);

bauchinj
17 Dec 2009, 7:12 AM
Sorry, but I don't be able to work on it today, I'll start tomorrow to work on it - and it wouldn't be as different as today I-|