Results 1 to 2 of 2

Thread: PropertyGrid and JSON

  1. #1

    Default PropertyGrid and JSON

    Hello,
    I have a json like this:
    Code:
    [{"k":"key1","v":"value1"},{"k":"key2","v":"value2"}]
    I would like to populate a propertyGrid with that value, stripped of "k" and "v".

    Something like this:

    key1: value1
    key2: value2

    I'm unable to do that, i don't know very well javascript.

  2. #2
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246

    Default

    PHP Code:
    var datas = [{"k":"key1","v":"value1"},{"k":"key2","v":"value2"}];

    var 
    = {}, i;
    for(
    0datas.lengthi++) {
      
    o[datas[i].k] = o[datas[i].v];
    }
    datas o

Similar Threads

  1. Example of propertyGrid
    By Hon in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Jun 2008, 12:31 AM
  2. PropertyGrid
    By mnask79 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 18 May 2008, 1:29 AM
  3. PropertyGrid from JSON
    By domtes in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 3 Mar 2008, 4:02 AM
  4. Populate a PropertyGrid from Json
    By mino in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 29 Nov 2007, 10:08 AM
  5. PropertyGrid and Xml or Json Datasources
    By sfwalter in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 7 Apr 2007, 5:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •