i can't find out wrong point
datas are parsed well but pagination, ordering, search such as other features are not working....
does it matter caused by updating each datas on cell? -> plugin doesn't catch new datas?
please let me know...ㅜㅜ
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"pageLength": 15,
"info": true,
"autoWidth": false,
"responsive": false,
drawCallback: function(){
$('#example2_previous a').text('◀');
$('#example2_next a').text('▶');
}
});
$.ajax({
url: '/api',
type: 'POST',
data: JSON.stringify({"command":"getUnitList"}),
dataType: 'json',
success: function(data) {
if (data.error == 0) {
console.log(data.reply);
console.log(data.reply.data.length);
console.log(data.reply.data[0].apt_number);
console.log(data.reply.data[1].apt_number);
populateTable(data.reply); // 성공 콜백에서 테이블을 채우는 함수 호출
}
else {
console.log(data.errorString);
}
},
error: function (xhr, msg, err) {
console.log('code:' + xhr.status + '\n' + 'message:' + xhr.responseText + '\n' + 'error:' + err);
if(xhr.status == 401)
location.href = '/';
},
complete: function (jqXHR) {
console.log('api getInfo complete');
}
});