New to dataTables - Initialize and load data question
New to dataTables - Initialize and load data question
Christopher
Posts: 5Questions: 0Answers: 0
I am retrieving JSON using the JQuery $.ajax({ }) call and I am receiving the JSON back to the JSP page. I have created the html for the table in my JSP page as follows:
ID
Name
I have included the JQuery and dataTable links for CSS and JS
In my JQuery - I do the following:
$(document).ready(function() {
var aaData=[];
aaData.push({
"ID": "1000",
"Name": "Mike"
});
aaData.push({
"ID": "11000",
"Name": "Jim"
});
aaData.push({
"ID": "12000",
"Name": "John"
});
$('#example').dataTable( {
"aaData": aaData,
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});
I receive NULL values in my table. Does anyone know why the data will not paint?
I was only creating the array on the front end to test the load. I have JSON coming
back to the front-end I will load once I figure out the issue. Am I missing something?
I am seeing the table with the JQuery theme but no data except NULLs and a dialog that appears stating:
DataTables warning (table id = 'example'): Requested unknown parameter '0' from the data source for row 0.
Can anyone help? Thank you
ID
Name
I have included the JQuery and dataTable links for CSS and JS
In my JQuery - I do the following:
$(document).ready(function() {
var aaData=[];
aaData.push({
"ID": "1000",
"Name": "Mike"
});
aaData.push({
"ID": "11000",
"Name": "Jim"
});
aaData.push({
"ID": "12000",
"Name": "John"
});
$('#example').dataTable( {
"aaData": aaData,
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});
I receive NULL values in my table. Does anyone know why the data will not paint?
I was only creating the array on the front end to test the load. I have JSON coming
back to the front-end I will load once I figure out the issue. Am I missing something?
I am seeing the table with the JQuery theme but no data except NULLs and a dialog that appears stating:
DataTables warning (table id = 'example'): Requested unknown parameter '0' from the data source for row 0.
Can anyone help? Thank you
This discussion has been closed.
Replies
Allan