Question on retrieve option in datatable
Question on retrieve option in datatable
yu yen kan
Posts: 65Questions: 31Answers: 0
with retrieve: true
in datatable
$.ajax({
url: ".....",
type: 'GET',
success: function (response) {
try {
var json = JSON.parse(response);
var table = $("#table").DataTable({
retrieve: true,
data: json.data
});
}catch{
}
}
});
everytime I retrieve data from ajax, the table data is not update, is that it working like that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
The
retrieve
documentation states:That's what is happening here!
Use
clear()
to clear the old data androws.add()
to add the new if the table already exists.Allan