Broke when I added sname to get colreorder working... Looks like it matches to me...

Broke when I added sname to get colreorder working... Looks like it matches to me...

hb2brandonhb2brandon Posts: 6Questions: 0Answers: 0
edited April 2014 in DataTables 1.9
Error: DataTables warning (table id = 'customers'): Requested unknown parameter '0' from the data source for row 0

Creating the datatable:
[code]
var oTable = $('#customers').dataTable({
"sDom": 'CRT<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/resources/global/lib/dataTables/swf/copy_csv_xls_pdf.swf"
},
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"aaSorting": [[1, "asc"]],
"sAjaxSource": "/private/customer_leads/datatable_index",
"sScrollX": "100%",
"bScrollCollapse": true,
"aoColumns": [
{"sName": "primary_agent"},
{"sName": "customers_full_name"},
{"sName": "customers_birthday"},
{"sName": "customers_company"},
{"sName": "customers_home_phone"},
{"sName": "customers_cell_phone"},
{"sName": "customers_assistant_phone"},
{"sName": "customers_email_address"},
{"sName": "customers_primary_address"},
{"sName": "customers_primary_city"},
{"sName": "customers_primary_state"},
{"sName": "customers_primary_zip"},
{"sName": "control_reassign"},
{"sName": "control_reassignA"}
],

"oLanguage": {"sSearch": "Search customer name:"}
});
[/code]

JSON from server:
[code]

[/code]

/ignore.. see comment below

Replies

  • hb2brandonhb2brandon Posts: 6Questions: 0Answers: 0
    edited April 2014
    /ignore
  • hb2brandonhb2brandon Posts: 6Questions: 0Answers: 0
    Ok.. I don't know what that CDATA stuff is. Bad copy.. Perhaps this is better:

    [code]
    {"sEcho":1,"iTotalRecords":"15000","iTotalDisplayRecords":"10","aaData":[{"primary_agent":"Unassigned","customers_full_name":"Clayton Abbott","customers_birthday":"10\/14\/2013","customers_company":"At Sem PC","customers_home_phone":"1-340-506-4759","customers_cell_phone":"1-110-807-5047","customers_assistant_phone":" ","customers_email_address":"ligula.Donec@scelerisquedui.edu","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Unassigned","customers_full_name":"Dolan Abbott","customers_birthday":"3\/13\/2014","customers_company":"Felis Industries","customers_home_phone":"1-747-448-0379","customers_cell_phone":"1-181-753-9382","customers_assistant_phone":" ","customers_email_address":"lorem.vehicula.et@at.net","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Garrison Abbott","customers_birthday":"8\/16\/2013","customers_company":"Diam Pellentesque Habitant Associates","customers_home_phone":"1-970-452-2864","customers_cell_phone":"1-607-641-2669","customers_assistant_phone":" ","customers_email_address":"nascetur.ridiculus.mus@euismodmauriseu.org","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Gavin Abbott","customers_birthday":"12\/16\/2014","customers_company":"Quam Incorporated","customers_home_phone":"1-404-666-1280","customers_cell_phone":"1-500-955-6886","customers_assistant_phone":" ","customers_email_address":"cubilia.Curae.Phasellus@erat.com","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Giacomo Abbott","customers_birthday":"8\/5\/2013","customers_company":"Accumsan Convallis Ante Incorporated","customers_home_phone":"1-458-403-6489","customers_cell_phone":"1-929-496-9178","customers_assistant_phone":" ","customers_email_address":"magnis.dis.parturient@acarcuNunc.net","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Tanek Abbott","customers_birthday":"7\/30\/2013","customers_company":"Erat Neque Company","customers_home_phone":"1-799-454-7753","customers_cell_phone":"1-877-404-7162","customers_assistant_phone":" ","customers_email_address":"Integer.in.magna@Suspendissenon.co.uk","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Thane Abbott","customers_birthday":"4\/24\/2014","customers_company":"Erat LLC","customers_home_phone":"1-650-558-4252","customers_cell_phone":"1-720-165-6975","customers_assistant_phone":" ","customers_email_address":"luctus@ornarelectus.org","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Unassigned","customers_full_name":"Aidan Acevedo","customers_birthday":"11\/1\/2013","customers_company":"Egestas Company","customers_home_phone":"1-491-339-6172","customers_cell_phone":"1-346-915-7127","customers_assistant_phone":" ","customers_email_address":"Integer.vulputate@Morbinon.com","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Caesar Acevedo","customers_birthday":"3\/2\/2015","customers_company":"Vel Nisl Industries","customers_home_phone":"1-711-279-2693","customers_cell_phone":"1-612-578-3676","customers_assistant_phone":" ","customers_email_address":"scelerisque.dui@loremegetmollis.com","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""},{"primary_agent":"Mike O'Brien","customers_full_name":"Channing Acevedo","customers_birthday":"8\/14\/2013","customers_company":"Interdum Curabitur Corp.","customers_home_phone":"1-632-105-1145","customers_cell_phone":"1-440-786-8562","customers_assistant_phone":" ","customers_email_address":"nulla.Integer.urna@imperdietullamcorperDuis.com","customers_primary_address":"","customers_primary_city":"","customers_primary_state":"","customers_primary_zip":"","control_reassign":"","control_reassignA":""}]}
    [/code]
  • allanallan Posts: 63,578Questions: 1Answers: 10,483 Site admin
    The CDATA stuff is XML - it just allows you to put in freeform text into an XML text node.

    Looks like the JSON data being returned from the server isn't being correctly JSON encoded (unless the new lines really are being escaped and the forum syntax highlighter is doing something funny - entirely possible!).

    Allan
  • hb2brandonhb2brandon Posts: 6Questions: 0Answers: 0
    edited April 2014
    This ended up working after I added mData /please close
This discussion has been closed.