Commit fbd61930 by Lalang Trendy Buana Committed by nurchamim

modul: bug DataTable

status: selesai
keterangan: bug fix reload dataTable ketika AJAX complete pada `main_template.php`
parent 73d77fe4
...@@ -623,32 +623,32 @@ ...@@ -623,32 +623,32 @@
// window.Pace.stop(); // window.Pace.stop();
if (typeof request.responseJSON !== 'undefined') { if (typeof request.responseJSON !== 'undefined') {
if(request.responseJSON.csrf_token !== undefined) {
reconfigure(request); reconfigure(request);
}
} if (request.responseJSON.success == true) {
var tabel = $('div.dataTables_scrollBody > table'); var table_id = null;
if (tabel.length > 0) {
var id_tabel = tabel.attr('id'); if (typeof settings.table_id !== 'undefined') {
if (typeof request.responseJSON !== 'undefined') { table_id = settings.table_id;
if (request.responseJSON.success == true) { } else if (typeof request.responseJSON.table_id !== 'undefined') {
if ($.fn.DataTable.isDataTable('#' + id_tabel)) { table_id = request.responseJSON.table_id;
if (request.responseJSON.type == "save") { }
if ($('#' + id_tabel).DataTable().state() != null) { if (table_id) {
$('#' + id_tabel).DataTable().ajax.reload(null, false); if (table_id.toString().substring(0, 1) != '#') {
} else { table_id = '#' + table_id;
$('#' + id_tabel).DataTable().ajax.reload(null, false);
}
} else {
// table.ajax.reload(callback, resetPaging)
$('#' + id_tabel).DataTable().ajax.reload(null, false);
}
} }
if ($.fn.DataTable.isDataTable(table_id)) {
$(table_id).DataTable().ajax.reload(null, false);
}
} else {
$.each($.fn.dataTable.tables(), function () {
$(this).DataTable().ajax.reload(null, false);
});
} }
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment