Table data from a JSON object already memory?
Table data from a JSON object already memory?
Hi. Is it possible to use a JSON object already in memory as the data source for a table please? My page requests a big lump of data as JSON which contains many things to feed other "widgets" on the page and it also includes some data that needs to be shown in a table. I realise DataTables can request JSON data by itself through AJAX, but the data has already been loaded into my page for other uses and it would be very inefficient to allow DataTables to request the same data again.
The JSON object is quite big so below is an example of its structure. Assuming the var name is "data" I just want to give data.ForDataTables to DataTables so it can display that data.
[code]
{
"ForOtherWidgets": [
{
"date": "15 Mar 2011",
"name": "Rob Smith",
"speed": "96"
}
],
"ForDataTables": [
{
"description": "Blah blah",
"title": "Space craft",
"address": "Mars",
"type": "travel"
},
{
"description": "Yummy yummy",
"title": "Buildings",
"address": "Empire State",
"type": "city"
}
]
}
[/code]
Is this possible please? (And how!)
Thank you.
The JSON object is quite big so below is an example of its structure. Assuming the var name is "data" I just want to give data.ForDataTables to DataTables so it can display that data.
[code]
{
"ForOtherWidgets": [
{
"date": "15 Mar 2011",
"name": "Rob Smith",
"speed": "96"
}
],
"ForDataTables": [
{
"description": "Blah blah",
"title": "Space craft",
"address": "Mars",
"type": "travel"
},
{
"description": "Yummy yummy",
"title": "Buildings",
"address": "Empire State",
"type": "city"
}
]
}
[/code]
Is this possible please? (And how!)
Thank you.
This discussion has been closed.
Replies
Regards,
Allan
Best regards,
Gary.
Regards,
Allan