How to create nested tables from multidimensional json resultdata

How to create nested tables from multidimensional json resultdata

LalitkumarLalitkumar Posts: 1Questions: 1Answers: 0

Hi ,

I need help to generate table for my json results , i am unable to make it work on data table, do I need to make two data tables or it is achievable in single data table.

Answers

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    Basically the answer is yes you can do either. Here is a simple example of how to show the data in one table:
    http://live.datatables.net/kucujotu/1/edit

    It uses columns.render to render the array of sites objects into the column. Assuming that is what you want to do. Using Javascript map to iterate the specific sites object. You can use any Javascript methods in the function to achieve the output you want.

    It accesses the data using data.results. If you are using the ajax option then you will use the ajax.dataSrc option to point to results

    You will want to look at the Nested Objects Example.

    Please post any questions.

    Kevin

This discussion has been closed.