This is a migrated thread and some comments may be shown as answers.

Displaying two levels of data

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 04 May 2015, 10:19 PM

Hi All,

How would I achieve the following in Kendo Grid?  I have the following data return from a json call.

[Data]

   - Id  (1)

   - Name (Test)

   [SubData] :  Array[3]

      0: Object

          - NumberX  (999)

          - NumberY (888)

     1: Object          

         - NumberX  (123)     

         - NumberY  (456)

      2: Object       

          - NumberX  (789)       

          - NumberY  (222)

and I would like to display them in the following

Id    Name     NumberX    Number Y

1    Test         999             888

1    Test         123             456

1    Test         789             222

 

A sample would be appreciated.

 

TIA

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 06 May 2015, 11:26 AM

Hello Steve,

Displaying multiple rows of data, constructed from a single item, depending on the count of the items of array sub-property is not supported. In this case you should manually iterate the JSON result and construct the data in the expected flat array format for the Grid's dataSource.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or