Author: pkawiak
Date: 2008-09-10 08:43:36 -0400 (Wed, 10 Sep 2008)
New Revision: 10397
Modified:
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
Log:
RF-4325 (component not wrapped with form caused script hang)
fixed bug with JS errors present when refreshing a hidden modal
panel with extDt.
Modified:
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
===================================================================
---
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-09-10
12:35:36 UTC (rev 10396)
+++
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-09-10
12:43:36 UTC (rev 10397)
@@ -43,19 +43,20 @@
//remove listeners
this.selectionManager.removeListeners();
- this.header.removeListeners();
-
- var l = this.groupRows.length;
- for(var i = 0; i < l; i++) {
- Utils.DOM.Event.removeListeners(this.groupRows[i]);
- }
-
- var headerChildren = this.header.getColumnCells();
- l = headerChildren.length;
- for (var i=0; i<l-1; i++) {
- Utils.DOM.Event.removeListeners(headerChildren[i]);
- };
-
+ if (this.header) {
+ this.header.removeListeners();
+ var headerChildren = this.header.getColumnCells();
+ l = headerChildren.length;
+ for (var i=0; i<l-1; i++) {
+ Utils.DOM.Event.removeListeners(headerChildren[i]);
+ };
+ }
+ if (this.groupRows) {
+ var l = this.groupRows.length;
+ for(var i = 0; i < l; i++) {
+ Utils.DOM.Event.removeListeners(this.groupRows[i]);
+ }
+ }
//null all references to DOM elements
delete this.selectionManager;
delete this.header;
Modified:
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
===================================================================
---
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-09-10
12:35:36 UTC (rev 10396)
+++
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-09-10
12:43:36 UTC (rev 10397)
@@ -284,7 +284,8 @@
if(!groupingExists) { //simple listener binding
if(this.options.selectionMode != "none") {
for(var i = 0; i < this.rowCount; i++) {
- rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
+ var arr = nrows[i].id.split(this.prefix)[1].split(":");
+ rowIndex = Number(arr[arr.length-1]);
this.addListener(nrows[i], rowIndex);
}
}
@@ -322,8 +323,9 @@
lastGroupId = groupId;
} else {
if(this.options.selectionMode != "none") {
- rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
- this.addListener(nrows[i], rowIndex);
+ var arr =
nrows[i].id.split(this.prefix)[1].split(":");
+ rowIndex = Number(arr[arr.length-1]);
+ this.addListener(nrows[i], rowIndex);
}
groupItems[groupItem++] = nrows[i];
if ( (i==0) && (bHideFirstRow) ) {
@@ -581,8 +583,12 @@
this.removeRowFromSelection(j);
}
}
+ if(range[0] == range[1]) {
+ this.addRowToSelection(range[0]);
+ return;
+ }
var i = range[0];
- range[1] = (range[1] + 1) % this.rowCount;
+ range[1] = (range[1] + 1) % this.rowCount;
while (i != range[1]) {
this.addRowToSelection(i);
i = (i + 1) % this.rowCount;
Modified:
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
---
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-09-10
12:35:36 UTC (rev 10396)
+++
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-09-10
12:43:36 UTC (rev 10397)
@@ -83,7 +83,9 @@
<div id="#{clientId}:cs" class="extdt-hsplit"
style="display: none;"/>
<table id="#{clientId}:tu"
class="extdt-table-layout rich-table
#{component.attributes['styleClass']}"
- style="visibility:hidden;"
+ style="visibility:hidden;"
+ cellpadding="0"
+ cellspacing="0"
width="100%"
<colgroup
id="#{clientId}:colgroup:header">
@@ -96,8 +98,10 @@
<td colspan="#{columnsCount}" style="padding: 0px;">
<div id="#{clientId}:sd" class="extdt-content"
style="height:50px;width:100%;">
<table id="#{clientId}:n" width="100%"
- class="extdt-table-layout rich-table
#{component.attributes['styleClass']}"
- style="#{component.attributes['style']}"
+ class="extdt-table-layout rich-table
#{component.attributes['styleClass']}"
+ style="#{component.attributes['style']}"
+ cellpadding="0"
+ cellspacing="0"
<f:call
name="utils.encodePassThruWithExclusions">
<f:parameter
value="height,value,name,type,id,class,rows,style,width" />