Hi!
I have a problem, or better I would to understand this "magic".
I have this simple client side code:
and, on server side, I use IgnitedDatatables, https://github.com/IgnitedDatatables/Ignited-Datatables/.
Ok, when I process the request on server side, IgnitedDatatables returns me an array, where aaData array contain numerica arrays.
When I json_encode this object, on client, the arrays of rows in aaData are "magically" associative.
Server side :
on client, became associative:
I wonder, how? This seems to be related to use of "mData" in aColumns.
I have a problem, or better I would to understand this "magic".
I have this simple client side code:
var table = $('#document_search').dataTable({ "bProcessing": true, "bServerSide": true, 'sAjaxSource' : base_url("ajax/get_json/documents_search") , 'sPaginationType': 'full_numbers', 'bDestroy': true, 'aoColumns' : [ {'sTitle' : "document id","mData":'document_id'}, {'sTitle' : "paper id","mData":'paper_id'} ] });
and, on server side, I use IgnitedDatatables, https://github.com/IgnitedDatatables/Ignited-Datatables/.
Ok, when I process the request on server side, IgnitedDatatables returns me an array, where aaData array contain numerica arrays.
When I json_encode this object, on client, the arrays of rows in aaData are "magically" associative.
Server side :
"aaData": [ [ "4", "170" ], [ "5", "280", ], ... ]
on client, became associative:
"aaData": [ [ " paper_id" : "4", "document_id" : "170" ], [ " paper_id" : "5", "document_id" : "280", ], ... ]
I wonder, how? This seems to be related to use of "mData" in aColumns.