From: erickson Date: Thu, 4 Jun 2009 17:45:42 +0000 (+0000) Subject: make the selector cell onclick handler more dojo-y. added support for disabling... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=836270458df5f26e8c2ae7bbfff3bd6712dc2776;p=evergreen%2Fmasslnc.git make the selector cell onclick handler more dojo-y. added support for disabling selector cell based on user-defined callback. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13316 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 975917f0db..40fc62ddb8 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -53,9 +53,12 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { this._applySingleEditStyle(); if(!this.hideSelector) { - var header = this.layout.cells[0].view.getHeaderCellNode(0); - var self = this; - header.onclick = function() { self.toggleSelectAll(); } + dojo.connect(this, 'onHeaderCellClick', + function(e) { + if(e.cell.index == 0) + this.toggleSelectAll(); + } + ); } }, @@ -180,7 +183,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { var inputs = dojo.query('[name=autogrid.selector]', this.domNode); for(var i = 0; i < inputs.length; i++) { if(inputs[i].getAttribute('row') == rowIdx) { - inputs[i].checked = true; + if(!inputs[i].disabled) + inputs[i].checked = true; break; } } @@ -227,7 +231,10 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { _formatRowSelectInput : function(rowIdx) { if(rowIdx === null || rowIdx === undefined) return ''; - return ""; + var s = ""; }, _applySingleEditStyle : function() {