PDA

View Full Version : datecolumn on grid changes the date value



Tremal
24 Jan 2013, 4:59 AM
Hi,

I've writen the next code:


grid = Ext.create('Ext.grid.Panel', {
store: store,
autoScroll:true,
layout:'fit',
columns:[{
text: "${day}",
dataIndex: 'day',
width: 140,
filter: true,
sortable: true,
xtype: 'datecolumn',
format:'m/d/Y'
},{

The value which arrives to my browser is this one:

"day":"19/01/2013 00:00:00", (day/month/year)

But when the table ir rendered, the date showed is 07/01/2014 (month, day, year)

I don't understand why this change. Somebody can help me? Thanks

friend
24 Jan 2013, 5:25 AM
Make sure that the field declared in your data store uses the 'dateFormat' option, something like this:



fields: [{
name: 'day', type: 'date', dateFormat: 'd/m/Y H:i:s'
}]

Tremal
24 Jan 2013, 7:10 AM
Thank you friend! This was the solution.

In my code, the store was an Ext.data.Model.