PDA

View Full Version : Ext.form.Field override : Adding an icon to a form field of any type



arnold
14 Mar 2009, 9:40 AM
Ever wanted to add an icon next to a form field of any type?
Just to be able to add some behaviour like context specific help or some dynamics
like adding or removal of a form field (http://extjs.com/forum/showthread.php?t=62774). Well now you can!

This is how you do it :


{ fieldLabel: 'First Name',
name: 'first',
labelSeparator : '',
width: 230,
allowBlank:false,
iconCfg: {cls:'x-tool x-tool-help',clsOnOver:'x-tool-help-over'},
listeners : { 'onIcon' : {fn: function(field) {Ext.example.msg('onIcon','Implement behaviour');}}}
}


To get this up and running just unzip the attached demo in your examples folder of extjs.
And that's it. See the attached image for a sneak preview of the attached demo.
Have fun!

wemerson.januario
14 Mar 2009, 6:23 PM
congratulations, nice work!!!

trojanman190
25 Mar 2011, 6:41 AM
Awesome, thanks dude!