Spaces:
Sleeping

doluong6 commited on
Commit
92812e3
·
verified ·
1 Parent(s): 9bb57a7

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +4 -6
static/script.js CHANGED
@@ -688,20 +688,19 @@ async function hienThiHSKH() {
688
  const checked = (cell || "").toString().toLowerCase() === "x" ? "checked" : "";
689
  tbodyHtml += `<td><input type="checkbox" class="checkbox-cell" data-col="${col}" ${checked}></td>`;
690
  } else {
691
- tbodyHtml += `<td><input class="input-cell" type="text" value="${cell}" /></td>`;
692
  }
693
  }
694
  tbodyHtml += `</tr>`;
695
  });
696
 
697
- $("#bangHSKH tbody").html(tbodyHtml);
698
-
699
  const dt = $("#bangHSKH").DataTable({
700
  scrollX: true,
701
  autoWidth: false,
702
- pageLength: -1, // ✅ Mặc định hiển thị tất cả dòng
703
- lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tất cả"]],
704
  ordering: false,
 
 
705
  language: {
706
  search: "🔍 Tìm kiếm:",
707
  lengthMenu: "Hiển thị _MENU_ dòng",
@@ -717,7 +716,6 @@ async function hienThiHSKH() {
717
  }
718
  });
719
 
720
-
721
  function capNhatMauDong() {
722
  $("#bangHSKH tbody tr").each(function () {
723
  const checkbox = $(this).find(`td:eq(${fullIndex}) input[type="checkbox"]`);
 
688
  const checked = (cell || "").toString().toLowerCase() === "x" ? "checked" : "";
689
  tbodyHtml += `<td><input type="checkbox" class="checkbox-cell" data-col="${col}" ${checked}></td>`;
690
  } else {
691
+ tbodyHtml += `<td style="white-space: normal"><input class="input-cell" type="text" value="${cell}" /></td>`;
692
  }
693
  }
694
  tbodyHtml += `</tr>`;
695
  });
696
 
697
+ $("#bangHSKH tbody").html(tbodyHtml);
 
698
  const dt = $("#bangHSKH").DataTable({
699
  scrollX: true,
700
  autoWidth: false,
 
 
701
  ordering: false,
702
+ pageLength: -1, // ✅ Bắt buộc kết hợp với lengthMenu dưới đây
703
+ lengthMenu: [[-1, 10, 25, 50, 100], ["Tất cả", 10, 25, 50, 100]], // ✅ Chuyển Tất cả lên đầu
704
  language: {
705
  search: "🔍 Tìm kiếm:",
706
  lengthMenu: "Hiển thị _MENU_ dòng",
 
716
  }
717
  });
718
 
 
719
  function capNhatMauDong() {
720
  $("#bangHSKH tbody tr").each(function () {
721
  const checkbox = $(this).find(`td:eq(${fullIndex}) input[type="checkbox"]`);