I really see the server return new data, but the datatable still show the old data.
how can I refresh the datatable?
var table = $('#questionTable').DataTable({
"jQueryUI": true,
"destory": true,
"ordering": false,
"searching": false,
"paging": true,
"language": {
...
}
},
"columnDefs": [
{"bSearchable": false, "bVisible": false, "aTargets": [0]},
{"bSearchable": false, "bVisible": false, "aTargets": [1]},
{"bSearchable": false, "bVisible": false, "aTargets": [2]}
],
"processing": false,
"serverSide": true,
"ajax": "${context}/question/list.htm",
"columns": [
{"data": "id"},
{"data": "userId"},
{"data": "time"},
{"data": "question"}
]
});
$('#myQuestion').click(function () {
if (login()) {
var userId = $.cookie("userId");
table.ajax.url("${context}/question/my.htm?userId=" + userId).load();
}
});