Commit fa8b1349 by Ari Agung Prasetiyo

perbaikan click datatables

1 parent d80d8065
...@@ -146,9 +146,9 @@ ...@@ -146,9 +146,9 @@
let ${tableid}Columns = ${ structure: columns }; let ${tableid}Columns = ${ structure: columns };
function render_checkbox(value) { function render_checkbox(value) {
if (value === true) if (value === true)
return '<i class="fas fa-check-square" aria-hidden="true">'; return '<i class="fas fa-check-square" aria-hidden="true">';
if (value === false) if (value === false)
return '<i class="fas fa-minus-square" aria-hidden="true">'; return '<i class="fas fa-minus-square" aria-hidden="true">';
return value; return value;
} }
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
} }
return render_checkbox(false); return render_checkbox(false);
} }
} }
else if (${tableid}Columns[co].wg_select === true) { else if (${tableid}Columns[co].wg_select === true) {
${tableid}Columns[co].render = function (value) { ${tableid}Columns[co].render = function (value) {
if (value != null) if (value != null)
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
scrollX: ${ field.scroll_x }, scrollX: ${ field.scroll_x },
//scrollY: ${field.scroll_y}, //scrollY: ${field.scroll_y},
//dom: '<"row"<"col-md-8"<"toolbar">Bl><"col-md-4"fr>>tip', //dom: '<"row"<"col-md-8"<"toolbar">Bl><"col-md-4"fr>>tip',
dom: '<"row"<"col-md-8"<"toolbar">>><"row"<"col-md-8"Bl><"col-md-4"fr>>t<"row dt-footer"<"col-md-8" i><"col-md-4"p>>', dom: '<"row"<"col-md-8"<"toolbar">>><"row"<"col-md-8"Bl><"col-md-4"fr>>t<"row dt-footer"<"col-md-8 sub-foot" i><"col-md-4"p>>',
processing: true, processing: true,
serverSide: ${ server_side }, serverSide: ${ server_side },
data: param_data, data: param_data,
...@@ -261,11 +261,12 @@ ...@@ -261,11 +261,12 @@
}); });
} }
}); });
let tb = tb_array.join(' '); let tb = tb_array.join(' ');
$("div.toolbar").html(tb); $("div.toolbar").html(tb);
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;'); $("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$("div.dt-footer").attr('style', 'margin-left: -7px;'); $("div.dt-footer").attr('style', 'margin-left: -7px;');
$("div.sub-foot").attr('style', 'position:unset;');
$(".dataTables_scrollBody").attr('style', 'margin-top: -10px;'); $(".dataTables_scrollBody").attr('style', 'margin-top: -10px;');
$('#${tableid} tbody').on('click', ':checkbox', function () { $('#${tableid} tbody').on('click', ':checkbox', function () {
if (this.checked) m${tableid}CheckList.push($(this).val()); if (this.checked) m${tableid}CheckList.push($(this).val());
...@@ -322,7 +323,7 @@ ...@@ -322,7 +323,7 @@
splitted.length = splitted.length - 1; splitted.length = splitted.length - 1;
col_id = splitted.join("-"); col_id = splitted.join("-");
max_val = $("#" + col_id + '-max').val() max_val = $("#" + col_id + '-max').val()
} }
else { else {
max_val = this.value; max_val = this.value;
splitted.length = splitted.length - 1; splitted.length = splitted.length - 1;
...@@ -379,7 +380,7 @@ ...@@ -379,7 +380,7 @@
if (value !== undefined && value != null) if (value !== undefined && value != null)
if ($(this).val() === value) $(this).attr("checked", true); if ($(this).val() === value) $(this).attr("checked", true);
else $(this).attr("checked", false); else $(this).attr("checked", false);
} }
else { else {
value = localStorage.getItem(col_id); value = localStorage.getItem(col_id);
if (value !== undefined && value !== null) if (value !== undefined && value !== null)
...@@ -393,4 +394,4 @@ ...@@ -393,4 +394,4 @@
${structure:filter_scripts} ${structure:filter_scripts}
}); });
</script> </script>
</div>
\ No newline at end of file \ No newline at end of file
</div>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!