View Full Version : Can't see data in design mode

5 May 2010, 6:44 AM
Hi my new in Json and ExtDesigner

Could somebody be so nice and provide me example of json file with data proper to DataStore ?
I have created DataStore in ExtDesigner with fields:
id, name, surname, regDate
url property looks like this: /data/persons.json
in project properties url preffix is: http://localhost:8081/
I have tomcat instance running on port 8081 with data catalog with persons.json file inside
I do not know how this file should look like, what is relation with root property (in my case "data")
My Json file: [{"id":1,"name":"Paul","surname":"Noname","regDate":"24-04-2007"},{"id":1,"name":"Andrew","surname":"Learner","regDate":"24-04-2007"}]
When I try to load data I get error message:
Unable to load data using supplied configuration.
Open in browser: http://localhost:8081/data/persons.json

5 May 2010, 7:08 AM
And if you click on the link to open it in a browser does it come up?

Are you saying you set the root configuration to "data"?

if so, your json packet should look like:

{data: [{"id":1,"name":"Paul","surname":"Noname","regDate":"24-04-2007"},{"id":1,"name":"Andrew","surname":"Learner","regDate":"24-04-2007"}]}

5 May 2010, 7:09 AM
And if you've set the idProperty to "id" you will want to make sure that you use different id's in your JSON. Otherwise these records will overwrite each other.

5 May 2010, 7:34 AM
Thanks very much - it works now, I can see two rows now, but with empty last field "regDate". Type of this field is set to "date". When I change type to string column in grid has values with type date it has not.

5 May 2010, 7:44 AM
Did you set your dateFormat to the appropriate value? 'd-m-Y'

5 May 2010, 8:33 AM
I was trying 'dd-mm-YYYY' but 'd-m-Y' works fine. Thanks again !!
Right now I am seeing data in format: "Tue Apr 24 2007 00:00:00 GMT+200...etc" which is not in format d-m-Y. How rid of time and zone information ?

5 May 2010, 12:09 PM
Transform the column to a datecolumn. You can then specify a 'format' configuration such as 'd-m-Y' or whatever custom format you may want to use.

5 May 2010, 12:24 PM
And once again it works perfectly, thanks