PDA

View Full Version : Repositioning of Elements in a form



smartjo
20 Dec 2009, 10:15 PM
http://www.extjs.com/forum/attachment.php?attachmentid=17887&stc=1&d=1261375762



Hi,

I have attached to images of a form with some radio buttons and textfields. Please see img1. In that 2 radio buttons yes and no are there. Below that are textfield t1,t2,t3 and t4.

After a few lines below is the textfield 'Test'. When radiobutton 'no' is clicked the textfields t1,t2,t3and t4 are hidden. But i want the textfield 'Test' to be repositioned upwards as shown in img2.

http://www.extjs.com/forum/attachment.php?attachmentid=17888&stc=1&d=1261375762


This one is say is just an example. Actually is have many such yes or no conditions in my form and lots of textfields to be applied with this condition. So I'd like to know if any auto adjustment method is there in Ext.

Please help!!

Regards
Joe.

tot2ivn
20 Dec 2009, 11:21 PM
If you use the default Ext JS form, then yes, you can tune the form as you wanted quite simply. Check this out:

http://www.extjs.com/deploy/ext/examples/form/dynamic.html

http://www.ibm.com/developerworks/web/library/wa-aj-extjs/

Cheers,

Totti

Condor
20 Dec 2009, 11:48 PM
FormLayout uses standard HTML flow, so if any fields are hidden all remaining fields are moved up.

ps. You need Ext 3.0.1 or up with trackLabels:true to hide fields (or you need to use a patch).