PDA

View Full Version : Google Chrome - GridPanel - date fields don't display



NassimRahali
5 Mar 2012, 2:12 AM
Hello everybody, I hope you're all doing fine !
I already present my apologies for my poor english but I need some help.
So, I have a problem when I try to display the date columns of my grid (the date only displays on some rows for some reasons).It only happens when I use Google Chrome, I tried on Firefox (10.0.2) and on Internet Explorer 8, and it seems to work fine.


I use a gridPanel, the store I create has a reader (JSON) and a model :


Model : dmodel
fields: [{ name: 'Id' },
{ name: 'Dagboekcode'},
{ name: 'Documentnr', type: 'int' },
{ name: 'Documentdatum', type: 'date', format: 'Y-m-d' },
{ name: 'Leveringsdatum', type: 'date', format: 'Y-m-d' },
....


Store : mystore:
model : dmodel
...


Grid:
...
...
store: mystore
columns: { id: 'Documentdatum', dataIndex: 'Documentdatum', header:
'Documentdatum', renderer: Ext.util.Format.dateRenderer('Y-m-d') },
{ id: 'Leveringsdatum', dataIndex: 'Leveringsdatum', header:
'Leveringsdatum', renderer: Ext.util.Format.dateRenderer('Y-m-d') },
...


Here are somes rows of my JSON response :




{"Id": 0, ..., "Documentdatum": "19/09/2009 0:00:00", "Leveringsdatum": "19/09/2009 0:00:00", ... },
{"Id": 1, ..., "Documentdatum": "19/09/2009 0:00:00", "Leveringsdatum": "19/09/2009 0:00:00", ... },
{"Id": 2, ..., "Documentdatum": "10/03/2009 0:00:00", "Leveringsdatum": "10/03/2009 0:00:00", ... },
{"Id": 3, ..., "Documentdatum": "8/04/2009 0:00:00", "Leveringsdatum": "8/04/2009 0:00:00", ... },
{"Id": 4, ..., "Documentdatum": "5/01/2010 0:00:00", "Leveringsdatum": "5/01/2010 0:00:00", ... }
And some screenshots of the result :


Firefox :


32384


Internet Explorer :


32385


Google Chrome :


32386


I started to use Ext JS for like 2 weeks and it's my first Javascript Framework so I'm not sure what I'm doing wrong / if I am doing something wrong.
Best regards,


Rahali Nassim.

Michi_72
5 Mar 2012, 2:26 AM
Hello,

i will try to help:

In your store you define the valueformat for the field like this


{ name: 'Documentdatum', type: 'date', format: 'Y-m-d' }

The receiving value looks different:


"Documentdatum": "19/09/2009 0:00:00"

Try to change server response like "2009-09-19" or the storeformat is like receiving format.

I hope i could help you!

Excuse my poor English!

Michi

NassimRahali
5 Mar 2012, 2:49 AM
I changed the server response to a format like "2009-09-19" and it's working on Chrome but not on Firefox anymore.

EDIT : It's ok, it works now. I had to send the date to a format exactly like :
- 2009-09-19
- 2008-03-06.

2009-9-19 or 2008-03-6 worked on Chrome but not on Firefox.

Thanks for your help.