PDA

View Full Version : Time format into grid



sanova
3 Jul 2012, 3:16 AM
I have some issues about displaying time into grid.
I get time from json in this format: 00:00:00

I set fields in the Ext.data.Model as follows:



{name: 'h_hour', mapping: 'h_hour', type: 'date', dateFormat: 'time'}
or
{name: 'h_hour', mapping: 'h_hour', type: 'date', dateFormat: 'timestamp'}


and in the grid as follows:



{header: 'Hour', flex: 15, dataIndex: 'h_hour', xtype: 'datecolumn', format: 'H:i', sortable: false}


The time displayed into grid is always 00:00 even if it gets from json something like this: 00:45:00

What can be wrong in my code?

Thanks in advanced

sword-it
3 Jul 2012, 4:33 AM
Hi,

Try to use format:'H: i : s' instead of format:'H:i'

sanova
3 Jul 2012, 5:24 AM
It's the same. I have just tried.

sword-it
3 Jul 2012, 5:31 AM
Hi,

You can check this link http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.column.Date
it will be helpfull