1. #1
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default How to load stored json data into Property Grid

    Does anyone know how to load json data into the Property Grid?
    I'm using SA2.

    I've read a code of Property Grid Example on this site.
    But,.....
    I don't know how to load data from json file instead of "souce" written in the same code file as below.

    http://docs.sencha.com/ext-js/4-0/#!/example/grid/property.html
    Code:
            source: {
                 "(name)": "Properties Grid",
                 "grouping": false,
                 "autoFitColumns": true,
                 "productionQuality": false,
                 "created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
                 "tested": false,
                 "version": 0.01,
                 "borderWidth": 1
             }

  2. #2
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default

    I'm still facing this problem.
    I hope someone help me.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    55
    Vote Rating
    0
    srxx123 is on a distinguished road

      0  

    Default

    There is the property grid store. But I have no idea how to bind this store to a prop grid in SA...

  4. #4
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default

    Thank you, srxx123.

    There is no the property grid store in Sencha Architect 2.0.
    (I cannot find it in SA2.0.)

    Does anyone know whether it is in SA2.1?

  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

    PropertyGrid's have a source configuration.

    You can grab a Json object via an Ajax request and then invoke setSource on the property grid.
    Aaron Conran
    @aconran

  6. #6
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default

    Thank you for the advice, Aaron.

    Could you show me the detail way step by step?
    I'm a beginner of SA2.

  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

      1  

    Default

    Code:
    Ext.Ajax.request({
       url: 'foo',
       success: function(response, opts) {
          var src = Ext.decode(response.responseText);
          myGrid.setSource(src);
       }
    });
    Aaron Conran
    @aconran

  8. #8
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default

    Thank you, Aaron.

    I will try your code later.
    It looks good.

  9. #9
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default It worked!

    Thank you, aconran.

    I'm so sorry to be late to say "Thank you!!!".

    It worked perfectly!

Thread Participants: 2