Problem with DataTables warning (table id = 'dataTableSet'): Requested unknown parameter '0' from th

Problem with DataTables warning (table id = 'dataTableSet'): Requested unknown parameter '0' from th

dragon001dragon001 Posts: 3Questions: 0Answers: 0
edited August 2012 in General
I have a problem with the DataTables.
This is my first try with dynamic data Pooling.
I get this error:
DataTables warning (table id = 'dataTableSet'): Requested unknown parameter '0' from the data source for row 0

Here's the Code of the Table
[code]




{translate text="application_Admin_log_date"}


{translate text="application_Admin_log_description"}


{translate text="application_Admin_log_user"}






{translate text="application_Admin_log_date"}


{translate text="application_Admin_log_description"}


{translate text="application_Admin_log_user"}




{literal}

$(document).ready(function() {
$('#dataTableSet').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "{/literal}{link modul="statistik" action="logData"}{literal}",
"sAjaxDataProp": "aaData"
});
} );

{/literal}
[/code]

Ok, this is the json data:

[code]{"sEcho":100,"iTotalRecords":64,"iTotalDisplayRecords":25,"aaData":[{"Date":"1335720677","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335720782","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721198","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721200","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721212","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721213","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721233","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721343","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721442","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721502","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721750","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721839","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721874","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721888","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721889","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721891","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721904","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721912","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721982","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721987","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721998","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335721999","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335722001","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335722003","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""},{"Date":"1335722012","Action":"Email Report to: noreply@test.de has been sent. Result: Success","User":""}]}[/code]

I tried different stuff.
I'm using a php script that creates the data.
I validated that the aaData is an array in array set.
But I still get the same problem.
Hope somebody can help me here.


Chris

Replies

  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    You need to use mData to tell DataTables what data to use from the data source objects if you are going to use objects : http://datatables.net/blog/Extended_data_source_options_with_DataTables .

    Allan
  • dragon001dragon001 Posts: 3Questions: 0Answers: 0
    According the link you gave me I modified the init part like this:

    [code]

    {literal}

    $(document).ready(function() {
    $('#dataTableSet').dataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "{/literal}{link modul="statistik" action="logData"}{literal}",
    "sAjaxDataProp": "aaData",
    "aoColumns": [
    { "mData": "Date" },
    { "mData": "Action" },
    { "mData": "User" }
    ]
    });
    } );

    {/literal}
    [/code]

    But I still get a DataTables warning (table id = 'dataTableSet'): Requested unknown parameter '0' from the data source for row 0 Message.
  • dragon001dragon001 Posts: 3Questions: 0Answers: 0
    solved the problem by revamping the output to a strait array(array) dataset.
    thx anyway
This discussion has been closed.