handle the lack of non-existent settings. if settings already loaded, use those
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Oct 2008 15:57:11 +0000 (15:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Oct 2008 15:57:11 +0000 (15:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10808 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/GridColumnPicker.js

index 541e591..628fffb 100644 (file)
@@ -200,6 +200,8 @@ if(!dojo._hasResource["openils.GridColumnPicker"]) {
         },
 
         load : function() {
+            if(this.setting)
+                return this._loadColsFromSetting(this.setting);
             var picker = this;
             fieldmapper.standardRequest(
                 ['open-ils.actor', 'open-ils.actor.patron.settings.retrieve'],
@@ -209,8 +211,13 @@ if(!dojo._hasResource["openils.GridColumnPicker"]) {
                         var set = r.recv().content();
                         if(e = openils.Event.parse(set))
                             return alert(e)
-                        if(set) 
+                        if(set) {
                             picker._loadColsFromSetting(set);
+                        } else {
+                            picker.build();
+                            picker.grid.setStructure(picker.structure);
+                            picker.grid.update();
+                        }
                     }
                 }
             );