requested unknown parameter 'Table' from the data source for row 0

requested unknown parameter 'Table' from the data source for row 0

gerennegerenne Posts: 30Questions: 0Answers: 0
edited March 2012 in General
Hi all,

I've the following problem, I try to do a simple DataTable with a normal array, but when the web page is loaded , to appear the following error:

requested unknown parameter 'Table' from the data source for row 0.


$('#table').dataTable( {
"aaData": arrayData, //this is the normal array
"aoColumns": [
{ "mDataProp": 0 },
{ "mDataProp": 1 },
{ "mDataProp": 2 },
{ "mDataProp": 3 },
{ "mDataProp": 4 },
{ "mDataProp": 5 }
]

} );

The jsp file:



column 0
column 1
column 2
column 3
column 4
column 5





Thanks in advance.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    http://datatables.net/faqs#unknown_parameter

    Can you use the debugger please.

    Allan
  • gerennegerenne Posts: 30Questions: 0Answers: 0
    Hi Allan,

    I've used the debugger, and I can see that the columns information is correct, but I'm afraid that the problem is in the rows, because when the table debugger show the information about row 1, it's show:

    {
    "0" : "s"
    "1" : "o"
    "2" : "u"
    "3" : "r"
    "4" : "c"
    "5" : "e"
    }

    The information that appear is the word that it should be in the row 1, column 1....

    I copy the link of debugger: http://debug.datatables.net/uxihiv

    Thanks in advcance!
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    > "aaData": [1, "source", "Request", "admin"

    That's the problem - your array is only 1D, so there is no separation between arrays and columns. It needs to be an array of arrays - i.e. each inner array is a row.

    Allan
  • gerennegerenne Posts: 30Questions: 0Answers: 0
    Great!!!

    It's true!!, the table is correct now.

    A lot of thanks, Allan.
This discussion has been closed.