Is there a way to set the Ext.form.DateField 'id' and 'name' before render?
This doesn't work:
I end up with this:
On the list of Ext sugar to make things sweet: it would be great if we could just specify a field name to transform into a date picker.
A nice time picker would make my day too.
This doesn't work:
function setup() {
var d = new Ext.form.DateField({id:'test_form', name:'test_name'});
d.render('container');
d.setValue('01/01/08');
}
<div id="container">
<div style="width: 109px;" id="ext-gen7" class="x-form-date-wrap"><input title="" class="x-form-field" id="ext-gen6" size="16" autocomplete="off" type="text"></div></div>
<input name="commit" value="Create" type="submit">
</p>
</form>
On the list of Ext sugar to make things sweet: it would be great if we could just specify a field name to transform into a date picker.
A nice time picker would make my day too.

|
#2
|
|
In the next rev coming shortly you can do all of the following:
var d = new Ext.form.DateField({
id:'test_form',
name:'test_name'
});
d.render('container');
d.setValue('01/01/08');
var d = new Ext.form.DateField({
id:'someId' // <-- name will default to id
});
d.render('container');
d.setValue('01/01/08');
var d = new Ext.form.DateField({
id:'test_form',
name:'test_name',
value: '01/01/08'
});
d.render('container');
var d = new Ext.form.DateField({
target:'existing-element', // <-- does not mess with id or name
value: '01/01/08'
});
![]() |
1628

被折叠的 条评论
为什么被折叠?



