Author: konstantin.mishin
Date: 2008-03-19 10:33:47 -0400 (Wed, 19 Mar 2008)
New Revision: 6949
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
Log:
RF-1780
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
---
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2008-03-19
14:13:33 UTC (rev 6948)
+++
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2008-03-19
14:33:47 UTC (rev 6949)
@@ -279,20 +279,22 @@
setListeners: function() {
var frows = $(this.prefix + ":f").rows;
var nrows = $(this.prefix + ":n").rows;
- this.rowCount = frows.length;
+ this.rowCount = nrows.length;
var rowIndex;
for(var i = 0; i < this.rowCount; i++) {
- rowIndex = Number(frows[i].id.split(this.prefix)[1].split(":")[2]);
+ rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
this.addListener(frows[i], rowIndex);
this.addListener(nrows[i], rowIndex);
}
},
- addListener: function(element, rowIndex) {
- var listener = this.processClick.bindAsEventListener(this, rowIndex);
- var cells = element.cells;
- for(var i = 0; i < cells.length; i++) {
- Utils.DOM.Event.observe(cells[i], "click", listener);
+ addListener: function(tr, rowIndex) {
+ if (tr) {
+ var listener = this.processClick.bindAsEventListener(this, rowIndex);
+ var cells = tr.cells;
+ for(var i = 0; i < cells.length; i++) {
+ Utils.DOM.Event.observe(cells[i], "click", listener);
+ }
}
},