Refactor multiple JavaScript classes to use ES6 syntax, including Download, Pdf, Printer, PrinterPos, PoleDisplay, and Simulator. Update method names for consistency and improve error handling. Modify AJAX requests to enhance functionality and user experience.

This commit is contained in:
2026-11-02 16:10:36 +07:00
parent 929f3af79a
commit 11e17bd978
6 changed files with 560 additions and 440 deletions
+3 -6
View File
@@ -784,7 +784,7 @@ class Request_JSF extends Request {
const opsi = {
responsive: true,
columnDefs: [{ responsivePriority: 1, targets: 0 }, { responsivePriority: 2, targets: 1 }, { responsivePriority: 0, targets: -1 }],
columnDefs: [{ responsivePriority: 1, targets: 0 }, { responsivePriority: 2, targets: 1 }],
lengthMenu: [],
dom: '<"row"<"col-sm-12"tr>><"row"<"col-sm-12 col-lg-auto"<"toolbar">><"col-sm-3 col-lg-auto ms-lg-auto"l><"col-sm-9 col-lg-auto"p>>',
autoWidth: false,
@@ -866,7 +866,7 @@ class Request_JSF extends Request {
};
}
if (ini.option.length > 0) opsi.columnDefs.push({ responsivePriority: 3, targets: -1 }, { orderable: false, targets: -1 });
if (ini.option.length > 0) opsi.columnDefs.push({ responsivePriority: 0, targets: -1 }, { orderable: false, targets: -1 });
if (ini.navi.no_navi === true) opsi.paging = false;
if (ini.config.scrollbar === true) {
@@ -900,7 +900,7 @@ class Request_JSF extends Request {
}
};
opsi.drawCallback = () => {
opsi.drawCallback = function() {
$(`#${ini.id}Tabel tbody td:last-child:has(span.rowcss)`).each((i, el) => {
const span = $(el).find('span').attr('class').replace('rowcss ', '');
$(el).parent().addClass(span);
@@ -1014,9 +1014,6 @@ class Request_JSF extends Request {
}
}
//const Request = (options) => new _Request(options);
//RequestF = (options) => new _Request_JSONF(options);
// jQuery Validator setup
if (jQuery.validator) {
jQuery.validator.setDefaults({