sorting icon columns after update columns by json
sorting icon columns after update columns by json
thiago_jobconvo
Posts: 1Questions: 0Answers: 0
i have a databe and one columns status , this column i update by ajax after load all page ,
because have a function vary large and after a change my columns with the gyphicon , i can't
sorting this columns ....
how i can fix it ?
this is code i used for update my values.
$(function (){
var candidate_list = $('table td.status_teste').map(function(){
return parseInt(this.id)
}).get();
console.log(candidate_list)
url = $('#url_hidden').attr('data-url')
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
data: {candidates:JSON.stringify(candidate_list)},
success: function(data){
$.each(data, function(index, value) {
if(value.has == true){
if(value.complete == true){
$('#'+value.user).find('img').remove()
$('#'+value.user).prepend('<spam class="text-success glyphicon glyphicon-ok-circle" style="font-size:1.5em"></spam>')
}else{
$('#'+value.user).find('img').remove()
$('#'+value.user).prepend('<spam class="text-warning glyphicon glyphicon-exclamation-sign" style="font-size:1.5em"></spam>')
}
}else{
$('#'+value.user).find('img').remove()
$('#'+value.user).prepend('<spam class="text-danger glyphicon glyphicon-remove-circle" style="font-size:1.5em"></spam>')
}
});
var datatable = $('#tbl').DataTable();
datatable.redraw();
}
});
});
This discussion has been closed.
Replies
I don't believe there is a Datatables API
redraw()
. Maybe you meant to usedraw()
on line 42, for example:datatable.draw();
.You probably have a console error indicating redraw is not a function stopping the script.
Kevin