Requested unknown parameter 'Status' from the

Requested unknown parameter 'Status' from the

FaenrylFaenryl Posts: 4Questions: 0Answers: 0
edited November 2012 in General
Hi,

i've got this error when i try to initialize a dataTable:
[code]
DataTables warning (table id = 'Table_Verifications'): Requested unknown parameter 'Status' from the data source for row 0
[/code]

I searched in this forum, and elsewhere, but could find what i'm doing wrong.
If you can explain my mistakes, thanks.

The html :
[code]




Status


Date


Email





[/code]

The js
[code]
$("#Table_Verifications").dataTable({
'bAutoWidth': false, // Disable columns width calculation, it's faster and sometimes produce very tiny columns.
'bProcessing': true, // Show "processing..." message during script processing
'bServerSide': true, // Tell datatables we'll use server-side processing
'sAjaxSource': '/admin/operational/getverifications', // name of Perl script which will return
'aoColumns':[
{'mData' : 'Status'},
{'mData' : 'Date'},
{'mData' : 'Email'}
]
});
[/code]

The json
[code]
{"sEcho":1,"iTotalRecords":2,"iTotalDisplayRecords":2,"aoColumns":[{"mDataProp":"Statut"},{"mDataProp":"Date"},{"mDataProp":"Email"}],"aaData":[["en_attente","2012-11-21 17:51:22","henricarte@yopmail.com"],["en_attente","2012-11-22 10:39:37","nicolas.lamblin@yopmail.com"]]}
[/code]
The debugger Link : http://debug.datatables.net/enuqur

Thanks for your replies.

Replies

  • FaenrylFaenryl Posts: 4Questions: 0Answers: 0
    And i have a question is-it possible to specify the columns in the response from the server?
  • allanallan Posts: 63,532Questions: 1Answers: 10,475 Site admin
    Your JSON data doesn't have `Status` , `Date` or `Email` properties in it - so DataTables is quite right to reject this. Have a look through this blog post: http://datatables.net/blog/Extended_data_source_options_with_DataTables

    Allan
  • FaenrylFaenryl Posts: 4Questions: 0Answers: 0
    Thanks, it worked.
    But how can i specify in the server response the columns to display.
    Thanks.
  • allanallan Posts: 63,532Questions: 1Answers: 10,475 Site admin
    You can't - that's a client-side operation. Use the mData option to specify the data you want to display.

    Allan
  • FaenrylFaenryl Posts: 4Questions: 0Answers: 0
    ok, hope this'll be in a future release.
This discussion has been closed.