PDA

View Full Version : form.Field - Other dom attributs



timb
13 Apr 2007, 9:11 AM
I would like to request a feature to be able to easily add other dom attributes when setting up fields. The main one I would like is tabIndex, but there could be others (such as title). Instead of adding one by one by request, maybe there could be a way to specify additional dom attributes like so:

new Ext.form.TextField({
fieldLabel: 'Company',
name: 'company',
width: 175,
attr: [{tabIndex: 5}, {title: 'Please enter the company name'}]}
}),

If you don't like this idea, could you still please add the tabIndex attribute? :)

Thanks!

timb
13 Apr 2007, 9:11 AM
Oops, I spelt attributes wrong in the title.

KimH
13 Apr 2007, 10:45 AM
I think you could clean it up like this:


new Ext.form.TextField({
fieldLabel: 'Company',
name: 'company',
width: 175,
attr: {tabIndex: 5, title: 'Please enter the company name' }
}),

timb
13 Apr 2007, 10:48 AM
Yeah, I've made that mistake a couple of times today. Thanks for clearing it up.

jack.slocum
13 Apr 2007, 11:54 AM
tabIndex is already there. It should have been in beta 2 but may have been added after?

For other attributes, you could try using autoCreate - it will allow you to set it up exactly how you want.

timb
13 Apr 2007, 12:04 PM
Hi Jack,

I got the latest from SVN, and it's there (it must have been added after beta 2).

I'll look into autoCreate a little bit more later, but it looks like it should be able to do the job.

Thanks!