the http response:
{}
not really great :(
enc.Encode(products) givs me a nil error
{"SEcho":"1","ITotalRecords":2,"ITotalDisplayRecords":2,"AaData":[{"ID":1,"Name":"Malm","Quantity":4,"Unit":"Pieces","Price":258.7,"Shippingcost":20,"Promisedate":"258.7"},{"ID":2,"Name":"Brimnes","Quantity":2,"Unit":"Pieces","Price":180.7,"Shippingcost":10,"Promisedate":"180.7"}]}
But I need the first char of SEcho, ITotalRecords, ITotalDisplayRecords and AaData in lowercase and
"AaData": [{"ID":1,"Name":"Malm","Quantity":4,"Unit":"Pieces","Price":258.7,"Shippingcost":20,"Promisedate":"258.7"},{"ID":2,"Name":"Brimnes","Quantity":2,"Unit":"Pieces","Price":180.7,"Shippingcost":10,"Promisedate":"180.7"}]}
should look like"aaData": [ [ "1", "Malm",
"4", "Pieces",
"258.7","20","258.7"
], []"2", "Brimnes",
"2", "Pieces",
"180.7","10","180.7"]
How to do so?
Ok, I get the aaData array working, but I need the struct members in lowercase for datatables. How?
I'm trying to do something similar and I'm stuck on the similar problem. How did you solve the aaData problem so the JSON is formatted properly for DataTables?
var table = $('#example').DataTable(
{
...
"sAjaxSource": "/api/allfirmware",
"columns": [
{
"class": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data": "make" },
{ "data": "model" },
{ "data": "interface" },
{ "data": "country" },
{ "data": "special" },
{ "data": "revision" }
],
});