added column picker support for suppressing picker actions on configured columns
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 May 2009 18:52:56 +0000 (18:52 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 May 2009 18:52:56 +0000 (18:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13094 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/GridColumnPicker.js
Open-ILS/web/vandelay/inc/queue.xml

index 0c61371..8e6d100 100644 (file)
@@ -52,13 +52,19 @@ if(!dojo._hasResource['openils.widget.GridColumnPicker']) {
 
                 dojo.forEach(this.getChildren(),
                     function(child) {
-                        for(var i in self.cells) {
-                            var name = self.cells[i].name;
-                            if(name == child.attr('label')) {
-                                child.field = {label:name, ident:self.cells[i].field};
-                                break;
-                            }   
-                        }
+                        dojo.forEach(self.cells,
+                            function(cell) {
+                                if(cell.name == child.attr('label')) {
+                                    if(cell.nonSelectable) {
+                                        console.log("removing child " + child.attr('label'));
+                                        self.removeChild(child);
+                                    } else {
+                                        child.field = {label:name, ident:cell.field};
+                                    }
+                                    return;
+                                }   
+                            }
+                        )
                     }
                 );
                 this.load();
index f8489c6..49568fb 100644 (file)
     function resetVlQueueGridLayout() {
         vlQueueGridLayout = [{
             cells : [[
-                {name: '&lt;input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
-                    get: vlQueueGridDrawSelectBox, styles : 'text-align: center;' },
-                {   name: '&vandelay.view.marc;', 
+                {
+                    name: '&lt;input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
+                    get: vlQueueGridDrawSelectBox, 
+                    styles : 'text-align: center;',
+                    nonSelectable : true
+                }, {   
+                    name: '&vandelay.view.marc;', 
                     get: vlGetViewMARC, styles : 'text-align: center;',
-                    value:'&lt;a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID, false, '+
-                        'function(){displayGlobalDiv(\'vl-queue-div\');});">&vandelay.view.marc;&lt;/a>'
-                },
-                {   name: '&vandelay.matches;', 
+                    value: '&lt;a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID, false, '+
+                        'function(){displayGlobalDiv(\'vl-queue-div\');});">&vandelay.view.marc;&lt;/a>',
+                    nonSelectable : true
+                }, {   
+                    name: '&vandelay.matches;', 
                     get: vlGetViewMatches, styles : 'text-align: center;',
-                    value:'&lt;a href="javascript:void(0);" onclick="vlLoadMatchUI(RECID);">&vandelay.matches;&lt;/a>'
-                },
-                {name: '&vandelay.import.time;', field:'import_time',  styles : 'text-align: center;',
-                    get:vlGetDateTimeField, selectableColumn:true}
+                    value:'&lt;a href="javascript:void(0);" onclick="vlLoadMatchUI(RECID);">&vandelay.matches;&lt;/a>',
+                    nonSelectable : true
+                }, {
+                    name: '&vandelay.import.time;', field:'import_time',  styles : 'text-align: center;',
+                    get:vlGetDateTimeField, 
+                }
             ]]
         }];
     }