Valid JSON, but different

Valid JSON, but different

orangeorange Posts: 20Questions: 0Answers: 0
edited February 2010 in General
Can I edit DataTables to read valid JSON in this format?

{
"ResultSet":
[

{
"Field1": "data",
"Field2": "data"
}
]
}

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    No - DataTables requires data to be given to it in a known format. The reason for this is that everyone would have a different format (e.g. I had no idea what you would give it an array with a key called 'ResultSet', and sub fields called 'Field1' etc!) - so there needs to be a standard that DataTables understands. This standard is simply a 2D data array (the key being aaData). You can use Javascript to transform from your ResultSet to the DataTables standard if you want.

    Regards,
    Allan
  • orangeorange Posts: 20Questions: 0Answers: 0
    Sounds good. Thank you.
This discussion has been closed.