PDA

View Full Version : bug in dateRenderer?



Thomas Triplet
4 Nov 2009, 8:55 AM
HI,

I've got a grid with a column to display a formated timestamp (it's actually a LiveGrid, but I get the same issue with regular GridPanels). The value is properly displayed in Chrome, but not in Firefox nor Safari. If I remove the renderer, the raw data is properly displayed and if I change the type of 'stamp' from date to string, I just get NaNs. Any idea?



var log = Ext.data.Record.create( [
{ name: 'connexion_log_id', type: 'int'},
{ name: 'username', type: 'string'},
{ name: 'ip', type: 'string'},
{ name: 'stamp', type: 'date'},
]);



var cmLogs = new Ext.grid.ColumnModel( [
{
header: ' ',
width: 35,
fixed:true,
align: 'center',
menuDisabled:true,
sortable: true,
groupable: false,
editable: false,
id: 'numberID',
dataIndex: 'connexion_log_id'

}, {
header: "Username",
sortable: true,
groupable: true,
width: 150,
id: 'logs_username',
dataIndex: 'username'

}, {
header: "IP",
sortable: true,
groupable: true,
id: 'logs_ip',
dataIndex: 'ip'

}, {
header: "Timestamp",
sortable: true,
groupable: true,
width: 170,
renderer: Ext.util.Format.dateRenderer('F jS, Y, g:i a'),
id: 'logs_stamp',
dataIndex: 'stamp'

}
]);


The data from the server is in JSON format as follows:


[{"connexion_log_id":"49","username":"thomas.triplet","ip":"127.0.0.1","stamp":"2009-11-03 15:59:54"},{"connexion_log_id":"48","username":"thomas.triplet","ip":"127.0.0.1","stamp":"2009-11-03 15:28:00"}