From d65a30a9e9d3ea755670744d231137435352b3e4 Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet <emmanuel.viennet@gmail.com>
Date: Sun, 3 Jul 2022 16:14:03 +0200
Subject: [PATCH] =?UTF-8?q?Tableaux=20recap:=20sauvegarde=20=C3=A9tat.=20C?=
 =?UTF-8?q?lose=20#414?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/static/js/table_recap.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/static/js/table_recap.js b/app/static/js/table_recap.js
index 1e13fd0d7..6102f485d 100644
--- a/app/static/js/table_recap.js
+++ b/app/static/js/table_recap.js
@@ -133,7 +133,7 @@ $(function () {
                 }
             });
         }
-        $('table.table_recap').DataTable(
+        let table = $('table.table_recap').DataTable(
             {
                 paging: false,
                 searching: true,
@@ -146,6 +146,7 @@ $(function () {
                 orderCellsTop: true, // cellules ligne 1 pour tri 
                 aaSorting: [], // Prevent initial sorting
                 colReorder: true,
+                stateSave: true, // enregistre état de la table (tris, ...)
                 "columnDefs": [
                     {
                         // cache les codes, le détail de l'identité, les groupes, les colonnes admission et les vides
@@ -208,7 +209,6 @@ $(function () {
                 "order": order_info,
             }
         );
-
     });
     $('table.table_recap tbody').on('click', 'tr', function () {
         if ($(this).hasClass('selected')) {
@@ -223,8 +223,8 @@ $(function () {
     $(function () {
         let row_selected = document.querySelector("#row_selected");
         if (row_selected) {
-            row_selected.scrollIntoView();
-            window.scrollBy(0, -50);
+            /*row_selected.scrollIntoView();
+            window.scrollBy(0, -50);*/
             row_selected.classList.add("selected");
         }
     });
-- 
GitLab