Error: oColumn is undefined

Error: oColumn is undefined

StefanieStefanie Posts: 3Questions: 0Answers: 0
edited July 2010 in General
First hello to all and thanks for this great script.

Version: 1.6.2
oColumn is undefined
Line 5110 oSettings.aaSorting[i][1] = oColumn.asSorting[0];

I'm running into this error on initializing, the data is requested by AJAX and an example result looks like:
[code]
{
"sEcho": 0,
"iTotalRecords": 1380,
"iTotalDisplayRecords": 2,
"aaData": [
[
"1",
"REQUEST.test",
"\">XXX",
"/?id=1&test=%22%3EXXX",
"80.153.61.21",
"8",
"85.13.131.86",
"2009-05-11 12:42:42"
],
[
"2",
"GET.test",
"\">XXX",
"/?id=1&test=%22%3EXXX",
"80.153.61.21",
"8",
"85.13.131.86",
"2009-05-11 12:42:42"
]
]
}
[/code]
Changed: Corrected the JSON result

My call is:

$(document).ready(function() {
$('#logdata').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "manager/index.php?a=112&id=3&getdata=1"
} );
} );


The table is defined as:
[code]



ID
Name

Value
Page
IP Address
Impact
Origin
Created





Loading data from server





ID
Name
Value
Page
IP Address

Impact
Origin
Created



[/code]

Does someone now what the problem might be?

Regards

Stefanie

Replies

  • JMartinezJMartinez Posts: 4Questions: 0Answers: 0
    Hey Stefanie,

    Without getting too in depth into your code... I noticed upon inspection that your inner arrays of "aaData" have a trailing comma. To me this would signify an undefined column value.

    ["1","REQUEST.test","/">XXX","/?id=1&test=%22%3EXXX","80.153.61.21","8","85.13.131.86","2009-05-11 12:42:42",]

    Notice the "," after ':42",' ...

    Joel
  • StefanieStefanie Posts: 3Questions: 0Answers: 0
    Hi Joel,

    thank you for seeing that comma, but unfortunately it does not solve my problem.

    Stefanie
  • JMartinezJMartinez Posts: 4Questions: 0Answers: 0
    edited July 2010
    I haven't tested it, but your inclusion of

    [code]


    Loading data from server


    [/code]

    ...looks suspicious. It's like its trying to match that one "colspan='8'" column to the the other 8 "" tags you have above. Have you tried just putting a tag w/ nothing inside it?

    E.g.:

    [code]



    [/code]
  • StefanieStefanie Posts: 3Questions: 0Answers: 0
    Hi Joel,

    Thank you, but it didn't solve the problem.

    I took the table from here: http://datatables.net/examples/data_sources/server_side.html
    [code]


    Loading data from server


    [/code]
    The difference is, that the example has five columns and my table has eight.
This discussion has been closed.