Requested unknown parameter '0' from the data source for row 0

Requested unknown parameter '0' from the data source for row 0

chucke1992chucke1992 Posts: 8Questions: 0Answers: 0
edited March 2014 in DataTables 1.9
I'm using array of objects - convert list of objects using GSON. In debug console it looks like this
[code]
{ "aaData" : [
{ "email":"EEE", "login": "log1", "password" : "a235123151312", "id" : 1 },
{ "email":"EEE", "login": "log2", "password" : "a235123151312", "id" : 1 }
]}
[/code]
my datatable looks like this
[code]
var oTable1 = $('#usertable').dataTable({
"sPaginationType": "bs_full",
"bProcessing" : true,
"sAjaxSource" : "/loadusers.html",
"aoColumns": [
{ "mData" : "email" },
{ "mData" : "login" },
{ "mData" : "password" },
{ "mData" : "id" }
],
fnRowCallback: function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
$(nRow).on('click', function() {
if ($(nRow).hasClass('info')) $(nRow).removeClass('info');
else {
var arr = oTable1.fnGetNodes();
for (var i = 0; i < arr.length; i++) {
if ($(arr[i]).hasClass('info')) $(arr[i]).removeClass('info'); //one row per time
}
$(nRow).addClass('info');
}
});
}
});[/code]
with html
[code]


Email
Login
Password
ID



[/code]

but I've got an error - [quote]DataTables warning (table id = 'usertable'): Requested unknown parameter '0' from the data source for row 0[/quote] and it shows several rows but without any data.

P.S. An interesting thing - when I move ajax to .txt and read it using example with deep.txt - it works correctly


Also a question
[quote] how to ignore a column - for example password[/quote]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > how to ignore a column - for example password

    Just don't include it int he HTML or JS :-).

    > DataTables warning (table id = 'usertable'): Requested unknown parameter '0...

    Can you run the debugger over the table please: http://debug.datatables.net .

    Allan
  • chucke1992chucke1992 Posts: 8Questions: 0Answers: 0
    edited March 2014
    [quote]Just don't include it int he HTML or JS :-).[/quote]
    I see. Thanks!

    [quote]Can you run the debugger over the table please: http://debug.datatables.net .
    [/quote]
    Well the problem solved itself lol. I've restarted server several times - and now it works.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Fair enough - good to hear it works now :-)
This discussion has been closed.