upgrade ajax request from old datatables
upgrade ajax request from old datatables
I'm upgrading from old datables to news one.
I'm using ignited-datatables to interface codeigniter with datatables.
We have no matter weith old version but we wanna use editor and so upgrade to the last version.
This is responso from ajax call
{"sEcho":0,"iTotalRecords":2,"iTotalDisplayRecords":2,"data":[{"0":"1","1":"1","2":"22","3":"1.300,00","4":"IVA 22%","5":"286,00","6":"pippo","7":"<\/span><\/a><\/span><\/a>","DT_RowId":"1"},{"0":"16","1":"1","2":"2250","3":"500,00","4":"IVA 22% INDEDUCIBILE 50%","5":"110,00","6":"test descrizione","7":"<\/span><\/a><\/span><\/a>","DT_RowId":"16"}],"sColumns":"id,codice,iva_codice,imponibile_valore_valuta,iva,iva_valore_valuta,primanota_iva.descrizione_1,ACTION"}
what's matter?
why it doesn't work?
this is datable definition
$('#dt').DataTable( {
serverSide: true,
ajax: CI.base_url + "c_acquisti/righe_list/" + acquisto,
columns: [
{ bVisible: false },
{ bVisible: false },
{ bVisible: false },
{ render: $.fn.dataTable.render.number( '.', ',', 0, '€' ) },
null,
{ render: $.fn.dataTable.render.number( '.', ',', 0, '€' ) },
null,
{ "bSortable": false, "sWidth": "0", "sClass": "center" }
],
order: [ 1, 'asc' ],
tableTools: {
sRowSelect: "os",
sRowSelector: 'td:first-child',
aButtons: [
{ sExtends: "editor_create", editor: editor },
{ sExtends: "editor_edit", editor: editor },
{ sExtends: "editor_remove", editor: editor }
]
}
} );
Answers
It looks like the ignited-datatables interface is using the old style server-side processing parameters rather than the new style introduced in 1.10. I'm not sure if there is an update to ignited-datatables which allows use of the new parameters or not, but you can force DataTables to use the old style - the server-side processing legacy documentation explains how.
Allan
I change parameters... now my response is
{
"draw":1,
"recordsTotal":3,
"recordsFiltered":3,
"data":[
{
"0":"1",
"1":"01907210981",
"2":"pippo sas",
"3":"1",
"4":"123",
"5":"25\/07\/2014",
"6":"EUR",
"7":"2.196,00",
"8":"<\/span><\/a><\/span><\/a><\/span><\/a>",
"DT_RowId":"1"
},
{
"0":"3",
"1":"01907210981",
"2":"pippo sas",
"3":"3",
"4":"12",
"5":"01\/08\/2014",
"6":"EUR",
"7":"26,00",
"8":"<\/span><\/a><\/span><\/a>",
"DT_RowId":"3"
},
{
"0":"2",
"1":"01234567890",
"2":"pirla sas",
"3":"2",
"4":"123",
"5":"29\/07\/2014",
"6":"EUR",
"7":"1,22",
"8":"<\/span><\/a><\/span><\/a><\/span><\/a>",
"DT_RowId":"2"
}
]
}
but it doesn't work
Can you link to the page so I can take a look please? I'm not sure why it wouldn't work with the limited information currently available.
Allan
I just put all online here...
http://accesso.quiko.net/c_acquisti/elenco_fatture_acquisto
user: 03624950162
pwd: password
PS I removed "DT_RowId" data.. .but it still doesn't work
Seems to work okay for me.
You have:
and
for some reason thought which makes the table hidden.
Allan