PDA

View Full Version : Howto setup title of fieldset from record



kostysh
8 Dec 2011, 9:24 PM
Hi,
I have a Ext.form.Panel with 'fieldset' item inside. I need setup 'title' of this 'fieldset' from panel data record.
Fields inside 'fieldset' setted automaticaly (by name template), but I dont know how to setup 'title' in same way.

AndreaCammarata
9 Dec 2011, 6:04 AM
Hi kostysh.
Unfortunately there is no way to set a fieldset title in the same wy of loading the form fields by the "setRecord" function.
However, you can achieve that as follow:
Suppose you have a "title" field in your record which should be set as the Title of your fieldset.
At this point you should only get your field set component inside your form and set its title using the "title" record value.



myForm.getComponent('myFieldset').setTitle(record.get('title'));


Hope this helps.

kostysh
9 Dec 2011, 8:55 AM
Thanks, it works!