LP#1244547 Maintain Filter Settings on Library Settings Editor
authorAdam Bowling <abowling@emeralddata.net>
Thu, 22 Jan 2015 16:20:28 +0000 (11:20 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 20 Jun 2017 15:07:46 +0000 (11:07 -0400)
After applying a filter to the rows on the Library Settings
Editor, and then selecting a different OU, the filter settings
are not considered unless the user clicks the "Filter" button
once again.

This patch maintains the filter settings on the edior until
the user clicks the "Clear Filter" button.

Signed-off-by: Adam Bowling <abowling@emeralddata.net>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml

index 92bf2ea..20bfff2 100644 (file)
@@ -133,7 +133,11 @@ function osDraw(specific_setting) {
             names.push(key);
     }
     
-    osDrawNames(names);
+    if(dojo.byId('isFiltered') == 'true') {
+        osLimitSeen(dojo.byId('searchBox').value);
+    } else {
+        osDrawNames(names);
+    }
 }
 
 /**
@@ -143,7 +147,8 @@ var osCurrentSearchTimeout;
 function osSearchChange() {
     if(osCurrentSearchTimeout != null)
         clearTimeout(osCurrentSearchTimeout);
-        
+
+    dojo.byId('isFiltered').value = 'true';
     osCurrentSearchTimeout = setTimeout("doSearch()", 500);
 }
 
@@ -193,6 +198,7 @@ function doSearch() {
 }
 
 function clearSearch() {
+    dojo.byId('isFiltered').value = 'false';
     if(dojo.byId('searchBox').value != '') { // Don't refresh on blank.
         dojo.byId('searchBox').value = '';
         doSearch();
index 662bde0..da3f4ae 100644 (file)
@@ -85,6 +85,7 @@
                     
                     <form id='searchform' onSubmit='return doSearch()'>
                             <input type='text' dojoType='dijit.form.TextBox' id='searchBox' onkeypress='osSearchChange();' />
+                            <input type='hidden' dojoType='dijit.form.TextBox' id='isFiltered' value='false' />
                             <button type='submit' dojoType='dijit.form.Button'>&staff.server.admin.org_unit_settings.filter;</button>
                             <button dojoType='dijit.form.Button' onClick='clearSearch();'>&staff.server.admin.org_unit_settings.clear_filter;</button>
                     </form>