PDA

View Full Version : Form with extra html/stuff to the left or right.



dlgoodchild
4 Aug 2009, 7:32 AM
Hi guys,

Got a question with regards to the FormPanel. Say I add a textfield using the items attribute of the config for the panel; how would I go about adding an icon or text to the left or right of the textfield/combo/whatever. I would want to do this as well as using the label...

Such as an input for money, I might want to have something like:

Money: [__________]

where [____] denotes an input

or:
Money: [__________] (icon here)

Any suggestions, post config or during config would be appreciated.

Regards,

Dave.

steffenk
4 Aug 2009, 7:37 AM
you can append anything you want using the DomHelper

Ash2009
28 Oct 2009, 2:05 PM
I have the same requirement, only difference is I need to put it after the textfield

Efforts : [_______] %
Price : [_______] $

How to use DomHelper to acheive this?

Jaitsu
28 Oct 2009, 3:42 PM
To avoid the use of Ext methods and to keep your code clean, I always approach this with a columnlayout, so something as follows:



FormPanel
Fieldset
Panel (columnlayout)
Fieldset (left column) (form layout)
Fieldset (right column) (form layout)

Ash2009
29 Oct 2009, 11:19 AM
This worked for me in field render.
isMoneyCfg:{ tag: "span",style: "padding-left:2px;",html: "$" }

var dh = Ext.DomHelper;
dh.append(this.el.dom.parentNode,this.isMoneyCfg);