With GridPanel in ExtJs4, how to edit cell datetime
(without timefield
or datefield
) ?
I use this for a correct display :
{
header: 'date_event',
field: {
type: 'datecolumn',
// format: 'Y-m-d H:i' // do nothing on rendering ou editing
},
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i')
}
But, when I edit my cell rendered as 2011-09-08 09:18
, the input was transformed :
Thu Sep 08 2011 09:18:00 GMT+0200 (Romance Daylight Time)
Can I keep the format render for editing?
Alternativly, using type: 'datecolumn'
and xtype: 'datefield'
or timefield
is working fine.
But without datetimefield
, I was unable to edit both date and time.
Preferring using a full date and time editor, how to edit it in text format formatted by my date pattern?
{
header: 'date_event',
xtype: 'datecolumn', // convert 开发者_如何学Gowith locale FR (without displaying hours) : 08/09/2011
field: {
xtype: 'datefield', // can edit days
// xtype: 'timefield', // can edit hours
// xtype: ['datefield','timefield'], // don't work
},
}
You can create your custom component that holds datefield and timefield together in hbox layout container. Implement setValue, getValue and other essential methods (if any) that affects both containing components. alias: 'widget.mydatepatterfield'. I think this approach will solve your problem.
精彩评论