PDA

View Full Version : DomQuery question



pex
17 Apr 2007, 5:35 AM
I use the following code to select all inputs from a form and dynamically add an Ext Form field to it:




var els = Ext.select('#formFields input.ext_dateinput');
var date = new Ext.form.DateField({
fieldLabel: 'Date of Birth',
width:190,
allowBlank:false
})
for (var i=0; i<els.elements.length; i++) {
date.applyTo(els.elements[i]);
}


Apart from sharing the code, I was wondering is there a faster way of doing this? Instead of looping through each returned element?