1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
    sshakil is on a distinguished road

      0  

    Default Popup editor grid on cell click in main grid, to edit array field from store w jsonrd

    Popup editor grid on cell click in main grid, to edit array field from store w jsonrd


    I'm having a hard time defining a strategy to implement the following.

    I have a grid panel that is currently displaying the following fields, as seen in the attached image.

    Columns R, E, S, and H are the same type of array fields from a store with a JSON reader. The returned JSON looks like:
    Code:
    { "data" : [ { "unusedCol1" : null,
            "unusedCol12" : null,
            "objects" : [ { "boolVal" : "0",
                  "d" : "B 1",
                  "n" : "H",
                  "v" : "102",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "",
                  "n" : "H",
                  "v" : "103",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "S",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "E",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "R",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                }
              ],
            "unusedCol13" : null,
            "id" : "444",
            "unusedCol4" : null,
            "name" : "testname",
            "unusedCol5" : null,
            "unusedCol6" : null,
            "version" : "1.1",
            "unsedCol7" : null,
            "unsedCol8" : null,
            "st" : "bla",
            "unusedCol9" : null,
            "unusedCol10" : null
          },
          { "unusedCol1" : null,
            "unusedCol12" : null,
            "objects" : [ { "boolVal" : "0",
                  "d" : "B 1",
                  "n" : "R",
                  "v" : "102",
                  "id" : "991",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "",
                  "n" : "R",
                  "v" : "103",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "H",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "S",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                },
                { "boolVal" : "0",
                  "d" : "G 1",
                  "n" : "E",
                  "v" : "104",
                  "id" : "444",
                  "st" : null
                }
              ],
            "unusedCol13" : null,
            "id" : "991",
            "unusedCol4" : null,
            "name" : "too",
            "unusedCol5" : null,
            "unusedCol6" : null,
            "version" : "1",
            "unsedCol7" : null,
            "unsedCol8" : null,
            "st" : "bla",
            "unusedCol9" : null,
            "unusedCol10" : null
          },
          { "unusedCol1" : null,
            "unusedCol12" : null,
            "objects" : [  ],
            "unusedCol13" : null,
            "id" : "334",
            "unusedCol4" : null,
            "name" : "ewe",
            "unusedCol5" : null,
            "unusedCol6" : null,
            "version" : "4",
            "unsedCol7" : null,
            "unsedCol8" : null,
            "st" : "Disabled",
            "unusedCol9" : null,
            "unusedCol10" : null
          },
          { "unusedCol1" : null,
            "unusedCol12" : null,
            "objects" : [  ],
            "unusedCol13" : null,
            "id" : "335",
            "unusedCol4" : null,
            "name" : "ewe",
            "unusedCol5" : null,
            "unusedCol6" : null,
            "version" : "4",
            "unsedCol7" : null,
            "unsedCol8" : null,
            "st" : "disabled",
            "unusedCol9" : null,
            "unusedCol10" : null
          }
        ],
      "success" : true,
      "total" : 7
    }
    I have the non-"unusedCol" columns displaying correctly.

    If there is a non-empty "objects" field, then I'd like to parse the "objects" field of array of objects for each parent of "objects" and determine if that list has objects that contains: none, one, or some, or all of field "n" with value "H", "R","S","E". Once this is determined, I'd like to display either a "Set" or "Not Set" in the cell corresponding to the header in the main grid for the parent object of the "objects" object. I'd like to be able to click on this "Set"/"Not Set" cell and add, edit, or delete the list of the "objects" objects.

    I have looked for a few hours, but I have not been able to find a component that would allow me to do this. I have discovered UX JPath, and that may be helpful, as it would let me map and query my objects. Also, I could spend time developing custom rendering functions to massage data onto the main grid and popup grid. However, that is the other part of my problem - how would I go about binding such a structure to a popup grid for each of the filter types? Some direction in this regard, or pointers, or link to any similar example would be very much appreciated.

    Time to get some rest.
    Attached Images

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,000
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    I am not aware of such an animal. You may have to create your own solution. Perhaps someone else has had the same need and can help out.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
    sshakil is on a distinguished road

      0  

    Default


    Hoping someone has...

    I've modified the returned JSON to separate the four types of "objects" arrays. Now I should be able to check for non-null "objectsH", "objectsR", "objectsE", and "objectsS" and at least display "Set"/"Not Set". Linking these array fields to a popup grid is something to be seen. I'm going to search for that a bit more.

Thread Participants: 1

Tags for this Thread