stateLoadCallback doesn't apply a saved stated from remote
stateLoadCallback doesn't apply a saved stated from remote
ricardooliveira
Posts: 3Questions: 1Answers: 0
Hello there I'm using statesavecallback and stateloadcallback to store an user specific preferences with visibility and ordering in datatables
'stateLoadCallback': function (settings) {
var data;
// Send an Ajax request to the server to get the data. Note that
// this is a synchronous request since the data is expected back from the
// function
$.ajax ({
'url': contextPath+'/app/loadTable?page='+thisPage,
'async': false,
'dataType': 'json',
'success': function (json) {
data = json;
loadTable = true;
}
});
return data;
},
'stateSaveCallback': function (settings, data) {
// Send an Ajax request to the server with the state object
data['pagina'] = thisPage;
if (!requestSent && loadTable) {
requestSent = true;
$.ajax ({
'url': contextPath+'/app/saveTable.json',
'data': data,
'dataType': 'json',
'type': 'POST',
'success': function () {},
'complete': function () { requestSent=false;}
});
}
}
However even though the request in loadstate is doing fine, it doesn't apply to the table, am I missing something?
This discussion has been closed.
Answers
Any help?
I tried using settings to set the loadestate and savedstate, but to no avail, here is the whole datatable initialization code
Hi I'm in the same situation.
alert(JSON.stringify(o));
show me clean valid JSON - However it isn't applied to the table though it is implemented in the constructor - I searched around but found no answer - wondering why this feature is available if it won't work.
I have the same problem. Does this feature work?
Could anyone with this issue give me a link to a page showing the issue so I can debug it please?
There was a bug in 1.10.13 which would have caused this, but it is resolved in 1.10.15.
Allan