Dynamic JSON data
Dynamic JSON data
I am having a problem poppulating dynamic content like the JSON below into JQuery Datatable.
I have tried the following code,
[code]$(document).ready(function () {
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./ajax1.html"
});
});[/code]
And the ajax.html contains the following JSON data,
[code]
[{
"date": "Date1",
"company": "Company1",
"location": "Location1"
},
{
"date": "Date2",
"company": "Company2",
"location": "Location2"
},
{
"date": "Date3",
"company": "Company3",
"location": "Location3"
}]
[/code]
Here date,company,location are table headers.
Can anyone help on it?
I have tried the following code,
[code]$(document).ready(function () {
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./ajax1.html"
});
});[/code]
And the ajax.html contains the following JSON data,
[code]
[{
"date": "Date1",
"company": "Company1",
"location": "Location1"
},
{
"date": "Date2",
"company": "Company2",
"location": "Location2"
},
{
"date": "Date3",
"company": "Company3",
"location": "Location3"
}]
[/code]
Here date,company,location are table headers.
Can anyone help on it?
This discussion has been closed.
Replies
Allan