PDA

View Full Version : datecolumn not storing data



robshim
25 Oct 2010, 6:19 AM
Hello,
I have made a datecolumn called 'raised'. It writes to the db and stores the date as a MySQL 'date' type, but when I refresh the page the date field is blank?

{id : 'raised',
xtype: 'datecolumn',
header: 'Date raised',
dataIndex: 'raised',
format: 'Y/m/d',
width: 100,
sortable: true,
groupRenderer: Ext.util.Format.dateRenderer('M y'),
editor: {
xtype: 'datefield',
allowBlank: true,
minValue: '01/01/2006',
minText: 'Can\'t have a start date before 01/01/06!',
maxValue: (new Date()).format('Y/m/d')
}
}

var schema = [
{ name: 'raised', type: 'date' }
];

Thanks,

Rob

Condor
25 Oct 2010, 7:29 AM
{name: 'raised', type: 'date', dateFormat: '????'}

robshim
26 Oct 2010, 12:05 AM
{name: 'raised', type: 'date', dateFormat: '????'}


Fantastic! Many thanks.
Rob

robshim
11 Nov 2010, 5:27 AM
Hi,
Sorry it is still not pulling the date field into the grid. It is writing to the db but if I refresh the html page the date is not there.

Here is my revised code:

{id : 'raised',
xtype: 'datecolumn',
header: 'Date raised',
dataIndex: 'raised',
format: 'Y/m/d',
width: 100,
sortable: true,
groupRenderer: Ext.util.Format.dateRenderer('M y'),
editor: {
xtype: 'datefield',
allowBlank: true,
minValue: '01/01/2006',
minText: 'Can\'t have a start date before 01/01/06!',
maxValue: (new Date()).format('Y/m/d')
}

var schema = [
{ name: 'raised', type: 'date', dateformat: 'Ymd' }
];


Many thanks,
Rob

Condor
11 Nov 2010, 6:32 AM
Is the date returned by your server always in 'Ymd' format?

robshim
11 Nov 2010, 7:27 AM
Is the date returned by your server always in 'Ymd' format?


Not sure. It is being input as Ymd by the row-editor and recorded as Ymd in the MySQL table.
Rob