save data table columns order
save data table columns order
Hi I have installed a lot of plugin for datatables, but I have try to disable all plugin and configuration for testing the saving of the columns order, but I've get no result :-(
I can move columns on table, "save" send configuration to server, "load" read configuration from server without error, but columns order is always the same.
data table is installed with bower, version 1.10.13, with colorder plugin 1.3.2
Can someone help me? thanks a lot.
My configuration is this:
$('#dynamic-table').DataTable(
{
"paging": false,
"colReorder": true,
"columns":
[
{'data': 'id','name': 'id'},
{'data': 'name','name': 'Ragione sociale'},
{'data': 'vat','name': 'Partita I.V.A.'},
{'data': 'fiscalCode','name': 'Codice fiscale'},
{'data': 'organizationCompanyType','name': 'Tipo compagnia'},
{'data': 'organizationCompanyRole','name': 'Ruolo azienda'},
{'data': 'ratingNote','name': 'Note sul rating'},
{'data': 'pagamentoServizi','name': 'Pagamento servizi'},
{'data': 'rating','name': 'Rating'},
{'data': '','name': ''},
{'data': 'navbar','name': ''},
],
"stateSave": true,
"stateSaveCallback": function(settings, data)
{
$.ajax(
{
"url": "/preferences-tables/save",
"data":
{
'id': '1',
'page': 'organization#index',
'data': data
},
"dataType": "json",
"type": "POST",
"success": function()
{
}
});
},
"stateLoadCallback": function(settings, callback)
{
$.ajax(
{
"url": '/preferences-tables/load',
"async": false,
"dataType": 'json',
"data":
{
'id': '1',
'page': 'organization#index'
},
// "type": "POST",
"success": function(json)
{
console.log(json);
console.log(callback);
callback(json);
}
});
},
});