PDA

View Full Version : Grid date columns



cweirich
4 Jun 2012, 12:10 PM
I'm finishing a demo and trying to show it to a client.

When I access it in localhost, it works perfectly:

35932

But when I try to access it from another computer, the grid date columns values disappear:

35933

I've checked the json response and it's the same as in localhost. And of course it's reading the json as the text column displays correctly.

What could be the reason for this?

Thanks.

ssamayoa
4 Jun 2012, 12:16 PM
That problem is not an SA issue but a framework issue.

Anyway, check the locale configured in both machines, also check the format of the dates the server is sending.

The best format for your date fields is 'c' (ISO 8601).

Regards.

cweirich
4 Jun 2012, 1:03 PM
Oh, sorry for misplacing the thread, I created it here because I'm using architect, but if any moderator could move it to the appropriate forum, I'd be thankful.

The problem is with compatibility mode in IE9. With it turned off, it works.
In Firefox it works too.

Is this known behavior?

ssamayoa
4 Jun 2012, 1:15 PM
Is this known behavior?

No idea. I use Chrome and advice to my users to use it.

Regards.

scottmartin
5 Jun 2012, 9:21 AM
If you add the following to html header, does it help?



<meta http-equiv="X-UA-Compatible" content="IE=8" />


Scott

evant
5 Jun 2012, 3:04 PM
Some browsers are more lenient than others in terms of native date parsing. If you're sending back a string from your server, you should specify the dateFormat config in your model so it can run the date through the Ext parser.

cweirich
6 Jun 2012, 4:41 PM
I've added the meta header and it makes the compatibilty mode button disappear, but in case it's activated by default, the dates are still gone.

The server is sending dates in ISO8601 format, ie "2000-12-31T00:00:00", so I didn't put anything in dateFormat. Should I?

ssamayoa
6 Jun 2012, 5:30 PM
In the model set date format to c

cweirich
6 Jun 2012, 6:12 PM
Ok, that works! Thank you!

What's the magic?

ssamayoa
6 Jun 2012, 6:17 PM
What's the magic?

Wne you set date format in the field definition you are telling to ExtJS code, explicitly, how the dates came from server so framework can convert to Date data type.

Regards.

cweirich
6 Jun 2012, 6:18 PM
I've accidentally marked my last post with "best answer" when I tried to mark ssamayoa's reply and don't know how to revert it.

cweirich
6 Jun 2012, 6:22 PM
Wne you set date format in the field definition you are telling to ExtJS code, explicitly, how the dates came from server so framework can convert to Date data type.


Ok but what does 'c' do? I haven't found it on the docs. Is it ISO8601? I thought it was default.

evant
6 Jun 2012, 6:30 PM
By default there is no format, it just passes it to the native Date() object.

A list of formats supported by the framework are here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Date

ssamayoa
6 Jun 2012, 7:56 PM
Ok but what does 'c' do? I haven't found it on the docs. Is it ISO8601? I thought it was default.

One of most dauting part of learning a new framework like ExtJS is to feel comfortable with the docs. A lot of information is there but until you "get it" you can find the information you need. This is my 9th major framework I have or want to learn (TurboVision in early 90s, VB in 93-94, Delphi's VCL '96, Java ~'99, Oracle's Developer & Oracle's Designer ~2000, JSF ~2004/5, RichFaces ~2007/8, Flex ~2008/9, ExtJS ~2010, ZK Framework 2012) so, after all previous ones, first thing I ever do is to check docs and figure out or google how to perform common tasks that I've already done before.

Sencha documentation, at it current state, is good one but as any big framework is very hard for new commers to start with, worst if you aren't US user.

Regards.