TypeError: aData is undefined
TypeError: aData is undefined
Hi there,
I'm putting together a new example of how we can use Functions within JED to concatenate Strings on the server side prior to sending the data to the client side for DataTables.
Please see online example: http://jed-datatables.ca/jed/examples/functions.html
My HTML looks like this:
[code]
...
Name
Landline Phone
Loading data from server
Name
Landline Phone
[/code]
My JavaScript looks like this:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "../jsp/functions.jsp",
"aoColumns": [
{ "mData": "name"},
{ "mData": "phone" }
]
} );
} );
[/code]
I'm returning an Object as a JSON string that looks like this:
[code]
[{"name":"Eunice Abaga","phone":"555-1234"},{"name":"Semali Abdelhak","phone":"555-4321"},{"name":"Susan Abenheimer","phone":"555-5748"},{"name":"Louise Adongo","phone":"555-0932"},{"name":"Sherri Aikenhead","phone":"555-0012"},{"name":"Samantha Aiton","phone":"555-0120"},{"name":"Toyin Akindoju","phone":"555-9122"},{"name":"Sameer Alladina","phone":"555-8112"},{"name":"Ken Allain","phone":"555-7744"},{"name":"Daniel Allen","phone":"555-7141"},{"name":"Mike Campbell","phone":"555-6021"},{"name":"Phil Collins","phone":"555-2234"},{"name":"Peter Finch","phone":"555-0602"},{"name":"Dave MacDonald","phone":"555-6490"},{"name":"Travis McKain","phone":"555-1153"},{"name":"Bill Paxton","phone":"555-1131"},{"name":"Zoie Prentice","phone":"555-3301"},{"name":"Bob Richards","phone":"555-1203"},{"name":"Chris Streeter","phone":"555-8455"},{"name":"Jessie Ventura","phone":"555-1903"},{"name":"Debbie Williams","phone":"555-6645"}]
[/code]
I'm getting a TypeError: aData is undefined
for ( i=0 ; i
I'm putting together a new example of how we can use Functions within JED to concatenate Strings on the server side prior to sending the data to the client side for DataTables.
Please see online example: http://jed-datatables.ca/jed/examples/functions.html
My HTML looks like this:
[code]
...
Name
Landline Phone
Loading data from server
Name
Landline Phone
[/code]
My JavaScript looks like this:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "../jsp/functions.jsp",
"aoColumns": [
{ "mData": "name"},
{ "mData": "phone" }
]
} );
} );
[/code]
I'm returning an Object as a JSON string that looks like this:
[code]
[{"name":"Eunice Abaga","phone":"555-1234"},{"name":"Semali Abdelhak","phone":"555-4321"},{"name":"Susan Abenheimer","phone":"555-5748"},{"name":"Louise Adongo","phone":"555-0932"},{"name":"Sherri Aikenhead","phone":"555-0012"},{"name":"Samantha Aiton","phone":"555-0120"},{"name":"Toyin Akindoju","phone":"555-9122"},{"name":"Sameer Alladina","phone":"555-8112"},{"name":"Ken Allain","phone":"555-7744"},{"name":"Daniel Allen","phone":"555-7141"},{"name":"Mike Campbell","phone":"555-6021"},{"name":"Phil Collins","phone":"555-2234"},{"name":"Peter Finch","phone":"555-0602"},{"name":"Dave MacDonald","phone":"555-6490"},{"name":"Travis McKain","phone":"555-1153"},{"name":"Bill Paxton","phone":"555-1131"},{"name":"Zoie Prentice","phone":"555-3301"},{"name":"Bob Richards","phone":"555-1203"},{"name":"Chris Streeter","phone":"555-8455"},{"name":"Jessie Ventura","phone":"555-1903"},{"name":"Debbie Williams","phone":"555-6645"}]
[/code]
I'm getting a TypeError: aData is undefined
for ( i=0 ; i
This discussion has been closed.
Replies
http://datatables.net/forums/discussion/comment/53291
among others.
Allan
$(document).ready(function() {
$('#example').dataTable( {
"sDom": "Tfrtip",
"aaSorting": [ ], // Prevent initial sorting
"sAjaxSource": "../jsp/functions.jsp",
"sAjaxDataProp": "",
"bProcessing": true,
"aoColumns": [
{ "mData": "name"},
{ "mData": "phone" }
]
} );
} );