1. #1
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    lazinskip is on a distinguished road

      0  

    Default Can't see data in design mode

    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

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,485
    Vote Rating
    136
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    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:
    Code:
    {data: [{"id":1,"name":"Paul","surname":"Noname","regDate":"24-04-2007"},{"id":1,"name":"Andrew","surname":"Learner","regDate":"24-04-2007"}]}
    Aaron Conran
    @aconran

  3. #3
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,485
    Vote Rating
    136
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    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.
    Aaron Conran
    @aconran

  4. #4
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    lazinskip is on a distinguished road

      0  

    Default

    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. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,485
    Vote Rating
    136
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    Did you set your dateFormat to the appropriate value? 'd-m-Y'
    Aaron Conran
    @aconran

  6. #6
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    lazinskip is on a distinguished road

      0  

    Default

    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 ?

  7. #7
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,485
    Vote Rating
    136
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    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.
    Aaron Conran
    @aconran

  8. #8
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    lazinskip is on a distinguished road

      0  

    Default

    And once again it works perfectly, thanks

Thread Participants: 1