Author: maksimkaszynski
Date: 2007-06-13 05:11:12 -0400 (Wed, 13 Jun 2007)
New Revision: 1149
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
Log:
switched back to Denis' code
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-12
18:23:59 UTC (rev 1148)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-13
09:11:12 UTC (rev 1149)
@@ -51,36 +51,32 @@
this._clearAttributes(row);
this.copyAttributes(row, src);
- for (var td = src.firstChild; td; td = td.nextSibling) {
-
- var outer = td.xml;
- var openTag = outer.indexOf('>');
- var closeTag = outer.lastIndexOf('<');
-
- var inner = outer.substring(openTag + 1, closeTag);
-
- var cell = createEl(td.tagName.toUpperCase());
-
- cell.innerHTML = inner;
-
-
-
- this.copyAttributes(cell, td);
- row.insertBefore(cell, null);
- }
+ var tds = [];
+ var i = 0;
+ var pattern = '(?:<td.*?>)((\n|\r|.)*?)(?:<\/td>)';
+ var rez = src.xml.gsub(pattern, function(item) {
+ tds[i++] = item[1];
+ return ""; });
+
- src = row;
- target.parentNode.replaceChild(src, target);
+ var count = i, td;
+ for(i=0; i< count; i++) {
+ td = createEl("TD");
+ td.innerHTML = tds[i];
+ td.className = "ClientUI_Grid_BC";
+ row.insertBefore(td, null);
+ }
+ target.parentNode.replaceChild(row, target);
+
+ return row;
} else {
target.innerHTML = src.innerHTML;
this._clearAttributes(target);
this.copyAttributes(target, src);
- src = target;
+ return target;
}
-
- return src;
},
_clearAttributes : function(node) {