Bug 15707: (QA follow-up) Switch to treetable which Koha already uses
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 19 Apr 2016 13:33:39 +0000 (13:33 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 18:40:50 +0000 (15:40 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt

index 4e25a54..6880b82 100644 (file)
@@ -1,15 +1,16 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Library groups</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% interface %]/lib/jquery-treegrid/js/jquery.treegrid.min.js"></script>
-<script type="text/javascript" src="[% interface %]/lib/jquery-treegrid/js/jquery.treegrid.bootstrap2.js"></script>
-<link rel="stylesheet" href="[% interface %]/lib/jquery-treegrid/css/jquery.treegrid.css">
+<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
 <script type="text/javascript">
 //<![CDATA[
     $(document).ready(function() {
-        $('#library-groups').treegrid(
+        $(".library-groups").treetable(
             {
-                'saveState': true
+                expandable: true,
+                initialState: "expanded",
+                clickableNodeNames: true,
             }
         );
     });
@@ -94,7 +95,7 @@
                 </div>
 
                 [% FOREACH root_group IN root_groups %]
-                    <table id="library-groups" class="tree">
+                    <table class="library-groups" class="tree">
                         <tr>
                             <th>&nbsp;</th>
                             <th>Description</th>
 [% INCLUDE 'intranet-bottom.inc' %]
 
 [% BLOCK tree %]
-    <tr class="treegrid-[% group.id %] treegrid-parent-[% group.parent_id %]">
+    <tr data-tt-id="[% group.id %]" data-tt-parent-id="[% group.parent_id %]">
         <td>
             [% IF group.branchcode %]
                 <i class="fa fa-home"></i> [% group.branchcode %]