PDA

View Full Version : timefield in grid cell editor



gabrikid
16 Oct 2014, 9:20 AM
Hi.

I have a grid column with a timefield editor. After editing the cell, I want the record to get a string with the defined format, which is "H:i". But the record always get the full date as a string.

(console.log of the record.data)
-------
hour: "Tue Jan 01 2008 00:10:00 GMT+0000 (GMT Standard Time)"
-------

(grid column editor)
-------
dataIndex: 'hour',
editor: {
xtype: 'timefield',
format: 'H:i',
submitFormat: 'H:i', //i tried with and without this config
increment: 10
}
-------

(model)
-------
{
name: 'hour',
type: 'string'

}
-------

I tried valueField: 'disp' (which should work, but does not) on the editor, and renderer: Ext.util.Format.dateRenderer('H:i') on column, but still does not solve the problem.

What is wrong here? Am I missing something?

watertrac_dev
17 Oct 2014, 5:17 AM
Would something like this do the trick?

bva

gabrikid
17 Oct 2014, 6:56 AM
hi.

it works, but with a problem. if you edit the column, you will notice that the editor (timefield) does not select the record's time. this happens because timefield manipulates date object. if we want the timefield to select that value, we need to ensure that the date part is the same of the date objects manipulated by the timefield. i think that this feature is bugged. the setvale should rely on the time, and not the full date...

c'mon sencha people, i expected more from this framework... i'm sorry, but it's true. i think that some features are not out of the box...

ByteLess
23 Sep 2016, 4:38 PM
Hi.

I have a grid column with a timefield editor. After editing the cell, I want the record to get a string with the defined format, which is "H:i". But the record always get the full date as a string.

(console.log of the record.data)
-------
hour: "Tue Jan 01 2008 00:10:00 GMT+0000 (GMT Standard Time)"
-------

(grid column editor)
-------
dataIndex: 'hour',
editor: {
xtype: 'timefield',
format: 'H:i',
submitFormat: 'H:i', //i tried with and without this config
increment: 10
}
-------

(model)
-------
{
name: 'hour',
type: 'string'

}
-------

I tried valueField: 'disp' (which should work, but does not) on the editor, and renderer: Ext.util.Format.dateRenderer('H:i') on column, but still does not solve the problem.

What is wrong here? Am I missing something?


I have the same issue with EXTJS6 framework.
whats your solution on this?