简体   繁体   中英

Assigning value to rowData but Array giving length 0 - Ag-grid

I have data with a specific format given below, I have stored the data in this.list But I have to assign this.list to a variable ie, rowData but It is showing array lenght 0 while list have data. Refer images for more clarity about question.

Response of list is showing here
Assigning data to rowData but getting nothing

JSON Data Format is-

[
  {
    group: 'Group A',
    participants: [
      {
        group: 'Menu',
        enable: 'Michael Phelps',
        menuType: '2008',
        url: 'United States',
        participants: [
          {
            group: 'Menu.1',
            enable: 'Michael Phelps',
            menuType: '2008',
            url: 'United States'
          }
        ]
      },
      {
        group: 'Menu2',
        enable: 'Michael Phelps',
        menuType: '2008',
        url: 'United States'
      }
    ]
  },
  {
    group: 'Group A',
    participants: [
      {
        group: 'Menu',
        enable: 'Michael Phelps',
        menuType: '2008',
        url: 'United States',
        participants: [
          {
            group: 'Menu.1',
            enable: 'Michael Phelps',
            menuType: '2008',
            url: 'United States'
          }
        ]
      },
      {
        group: 'Menu2',
        enable: 'Michael Phelps',
        menuType: '2008',
        url: 'United States'
      }
    ]
  }
]

Declaration

rowData:any

Calling it in function. Let's consider your response is in res

this.rowData= res ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM