-
☆ A M B ☆
- 24,524 Posts
This may be helpful to those creating CMPs with a grid that displays/edits a date field.
This is a simple modification of the Doodles grid for handling a date field. It will display and save the date in standard ISO format of year-month-date. Note the "renderer" and "editor" fields.
header: _('coupons.valid_from')
,dataIndex: 'valid_from'
,sortable: true
,width: 50
,renderer : Ext.util.Format.dateRenderer('Y-m-d')
,editor: new Ext.form.DateField({
format: 'Y-m-d'
})
[ed. note: sottwell last edited this post 14 years, 7 months ago.]
-
☆ A M B ☆
- 24,524 Posts
Well, learn something new every day! It's even easier, just use "datefield" as the editor's xtype value:
header: _('coupons.valid_from')
,dataIndex: 'valid_from'
,sortable: true
,width: 50
,renderer : Ext.util.Format.dateRenderer('Y-m-d')
,editor: { xtype: 'datefield' }