2

I have json data like this.

   [
  {
    "Name": "Alex",
    "Roll": 1,
    "collection": [
      {
        "Name": "Alex",
        "Roll": 1,
        "Class": 1,
        "stk": "Val1",
        "Marks": [
          {
            "Maths": 100,
            "Science": 200
          }
        ],
        "Weight": 50
      },
      {
        "Name": "Alex",
        "Roll": 1,
        "Class": 1,
        "stk": "Val2",
        "Marks": [
          {
            "Maths": 100,
            "Science": 200
          }
        ],
        "Weight": 60
      }
    ]
  },
  {
    "Name": "Brat",
    "Roll": 2,
    "collection": [
      {
        "Name": "Brat",
        "Roll": 2,
        "Class": 2,
        "stk": "Val1",
        "Marks": [
          {
            "English": 100,
            "History": 200
          }
        ],
        "Weight": 40
      },
      {
        "Name": "Brat",
        "Roll": 2,
        "Class": 2,
        "stk": "Val1",
        "Marks": [
          {
            "English": 100,
            "History": 200
          }
        ],
        "Weight": 30
      }
    ]
  },
  {
    "Name": "Cean",
    "Roll": 3,
    "collection": [
      {
        "Name": "Cean",
        "Roll": 3,
        "Class": 1,
        "stk": "Val1  ",
        "Marks": [
          {
            "Physic": 100,

          }
        ],
        "Weight": 40
      }
    ]
  }
]

I am preparing the nested grid like this from here. Kitch SInk

IN my case requirement is but different. As we can see in url the column is already defined here, but In my case upper column is predefind but the column in the nested grid is varry.

If you look into the data the marks which is in collection array have the same subject of one array and different then the previous array of collection. So marks is dynamic. Any way how to create the dynamic column ofthe nested grid.

My Column for first record is : stk, Maths and Science

My Column for first record is : stk, English and History

My Column for first record is : stk, Physics

Any light how to achive this.

David
  • 4,266
  • 8
  • 34
  • 69
  • check this out https://fiddle.sencha.com/#fiddle/1brc&view/editor – Jaydeep Sep 24 '19 at 12:16
  • I am able to achieve nested grid with expander, the way it is mentioned in fidller. My ask is how we can create dynamic column at grid rec level. Here in the nested grid we have only three specific colum. But in my case each rec have different column. – David Sep 24 '19 at 12:52
  • in rowExpanderGrid widget addInnerGridOnExpand is the method where you can create your own columns config and append it.. – Jaydeep Sep 24 '19 at 12:57
  • Ok let me try here, – David Sep 24 '19 at 13:09
  • @JD one small idea I want. I dynamic column for main also so which listener shall i call for pushing the column inside the column array – David Sep 24 '19 at 13:27
  • I guess you are talking about inner grids column, so you can use the expand listener of rowexpander, in that event you can push the columns using add method on columns array.. – Jaydeep Sep 24 '19 at 13:37
  • Nope, My question was for outer grid. I will figure that. Please tell me who to get this part `NestedGrid.ux.RowExpanderGrid` of your fiddler. – David Sep 24 '19 at 13:41
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/199913/discussion-between-j-d-and-david). – Jaydeep Sep 24 '19 at 13:44

0 Answers0