Unpopulated Data Table

Unpopulated Data Table

HornistHornist Posts: 9Questions: 1Answers: 0
edited July 2013 in DataTables 1.8
Debug code: ixudis

New to data tables, but I am not seeing a secondary request going from the browser to obtain data for a server side data population.

[code]
$(document).ready(function() {
$('#userList').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/index.php?controller=identity&action=getUserListFull",
"aoColumns": [
{ "mData": "firstName" },
{ "mData": "userEmail" },
{ "mData": "cellPhone" },
{ "mData": "addressLineOne" },
{ "mData": "" }
]
} );
} );
[/code]

The getUserListFill returns a Json package similar the one shown below:

[code]
{"sEcho": 1, "iTotalRecords": "2","iTotalDisplayRecords": "2","aoData":[{"identityId":"1","userName":"Admin","userEmail":hornist@gmail.com","firstName":"Steve","lastName":"hornist","cellNumber":"727-333-4444","phoneNumber":null,"addressLineOne":"17 ThatAve","addressLineTwo":null,"addressCity":"Coka Park","addressState":"FL","addressPostalCode":"32777"},{"identityId":"2","userName":"Dwayne","userEmail":"soup@gmail.com","firstName":"Darth","lastName":"vadre","cellNumber":"620-425-2299","phoneNumber":null,"addressLineOne":"172 MarcusAve","addressLineTwo":null,"addressCity":"Winter Wonderland","addressState":"FL","addressPostalCode":"33689"}]}
[/code]

Replies

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin
    First thing I would suggest is upgrading to 1.9.4. You are using a very old version of DataTables there. On which doesn't support mData in fact ( which was introduced in 1.9.4 - it was called mDataProp in 1.8+).

    Allan
  • HornistHornist Posts: 9Questions: 1Answers: 0
    I did drop in the latest version, but still get the following error:

    DataTables warning (table id = 'userList'): Requested unknown parameter '1' from the data source for row 0
  • HornistHornist Posts: 9Questions: 1Answers: 0
    This issue has to do with a column span. Resolved by ensuring the column count matches.
  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin
    Each column in the table must have a unique cell in the header (i.e. one which doesn't span columns) so that DataTables can attach sorting controls to it and more generally use it for column detection.

    Allan
This discussion has been closed.