Dynamic JSON data

Dynamic JSON data

lambypielambypie Posts: 1Questions: 0Answers: 0
edited July 2013 in General
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?

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    That's not a valid server-side processing response. If you want to use server-side processing you need to fully implement the protocol described here: http://datatables.net/usage/server-side

    Allan
This discussion has been closed.