From 469c578aa91f16b17b0d4519c8b050ba7931e539 Mon Sep 17 00:00:00 2001 From: valleet01 <thibaut.vallee@unicaen.fr> Date: Tue, 29 Mar 2022 14:06:57 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20d'un=20controle=20pour=20=C3=A9viter=20?= =?UTF-8?q?la=20d=C3=A9pendance=20a=20DataTable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../privilege-categorie/index.phtml | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/view/unicaen-privilege/privilege-categorie/index.phtml b/view/unicaen-privilege/privilege-categorie/index.phtml index 57a1a54..70e22cd 100644 --- a/view/unicaen-privilege/privilege-categorie/index.phtml +++ b/view/unicaen-privilege/privilege-categorie/index.phtml @@ -160,27 +160,30 @@ $canProvider = $this->isAllowed(PrivilegePrivileges::getResourceId(PrivilegeP $(function() { $('[data-toggle="popover"]').popover(); - $('#privilege-categorie-liste').DataTable( { - "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tous"]], - "order": [[4, 'asc']], - "language": { - 'lengthMenu': "Afficher _MENU_ éléments", - "search": "Filtre de recherche : _INPUT_", - "loadingRecords": "Chargement en cours...", - 'info': "<small class=\"text-highlight\">Affichage : <strong><i class=\"far fa-list-alt\"></i> _START_ - _END_ sur _TOTAL_</strong></small>", - 'infoEmpty': "", - 'infoFiltered': "<small class=\"text-highlight\">(_MAX_ éléments au total)</small>", - 'emptyTable': "Aucune donnée disponible.", - 'zeroRecords': "Aucun enregistrement trouvé.", - "paginate": { - "previous": "<i class=\"fas fa-chevron-left\"></i>", - "next": "<i class=\"fas fa-chevron-right\"></i>" - } - }, - "createdRow": function (row, data, index) { - $('.pop-ajax', row).popAjax(); - }, - }); + if(jQuery().dataTable) { + + $('#privilege-categorie-liste').DataTable({ + "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tous"]], + "order": [[4, 'asc']], + "language": { + 'lengthMenu': "Afficher _MENU_ éléments", + "search": "Filtre de recherche : _INPUT_", + "loadingRecords": "Chargement en cours...", + 'info': "<small class=\"text-highlight\">Affichage : <strong><i class=\"far fa-list-alt\"></i> _START_ - _END_ sur _TOTAL_</strong></small>", + 'infoEmpty': "", + 'infoFiltered': "<small class=\"text-highlight\">(_MAX_ éléments au total)</small>", + 'emptyTable': "Aucune donnée disponible.", + 'zeroRecords': "Aucun enregistrement trouvé.", + "paginate": { + "previous": "<i class=\"fas fa-chevron-left\"></i>", + "next": "<i class=\"fas fa-chevron-right\"></i>" + } + }, + "createdRow": function (row, data, index) { + $('.pop-ajax', row).popAjax(); + }, + }); + } $("body").on("event-unicaen-privilege-categorie-editer", function (event) { event.div.modal('hide'); -- GitLab