Special XML conversion code for Firefox >= 20.0
[infodrom/rico3] / minsrc / ricoLiveGridControls.js
index cd2989c..9dd0da8 100644 (file)
@@ -50,7 +50,7 @@ Rico.TableColumn.checkboxKey.prototype = {
   },
 
   _onclick: function(e) {
-    var elem=Event.element(e);
+    var elem=Rico.eventElement(e);
     var windowRow=parseInt(elem.id.substr((elem.id.lastIndexOf('_',elem.id.length)+1)));  //faster than split
     var v=this.getValue(windowRow);
     if (elem.checked)
@@ -115,7 +115,7 @@ Rico.TableColumn.checkbox.prototype = {
   },
 
   _onclick: function(e) {
-    var elem=Event.element(e);
+    var elem=Rico.eventElement(e);
     var windowRow=parseInt(elem.id.substr((elem.id.lastIndexOf('_',elem.id.length)+1)));  //faster than split
     var newval=elem.checked ? this._checkedValue : this._uncheckedValue;
     this.setValue(windowRow,newval);
@@ -185,71 +185,6 @@ Rico.TableColumn.textbox.prototype = {
 }
 
 
-Rico.TableColumn.HighlightCell = function(chkcol,chkval,highlightColor,highlightBackground,chkop) {
-  this.initialize(chkcol,chkval,highlightColor,highlightBackground,chkop);
-}
-
-Rico.TableColumn.HighlightCell.prototype = {
-/**
- * @class highlight a grid cell when a particular value is present in the specified column
- * @constructs
- */
-  initialize: function(chkcol,chkval,highlightColor,highlightBackground,chkop) {\r
-    this._chkcol=chkcol;\r
-    this._chkval=chkval;
-    this._chkop=chkop;\r
-    this._highlightColor=highlightColor;\r
-    this._highlightBackground=highlightBackground;\r
-  },\r
-\r
-  _clear: function(gridCell,windowRow) {\r
-    gridCell.style.color='';\r
-    gridCell.style.backgroundColor='';\r
-    gridCell.innerHTML=' ';\r
-  },\r
-\r
-  _display: function(v,gridCell,windowRow) {\r
-    var gridval=this.liveGrid.buffer.getWindowValue(windowRow,this._chkcol);\r
-    var match;\r
-    switch(this._chkop){
-        case '!=':
-          match=(gridval!=this._chkval);
-          break;
-        case '>':
-          match=(gridval>this._chkval);
-          break;
-        case '<':
-          match=(gridval<this._chkval);
-          break;
-        case '>=':
-          match=(gridval>=this._chkval);
-          break;
-        case '<=':
-          match=(gridval<=this._chkval);
-          break;
-        case 'abs>':
-          match=(Math.abs(gridval)>this._chkval);
-          break;
-        case 'abs<':
-          match=(Math.abs(gridval)<this._chkval);
-          break;
-        case 'abs>=':
-          match=(Math.abs(gridval)>=this._chkval);
-          break;
-        case 'abs<=':
-          match=(Math.abs(gridval)<=this._chkval);
-          break;
-        default:
-          match=(gridval==this._chkval);
-          break;
-    }
-    gridCell.style.color=match ? this._highlightColor : '';\r
-    gridCell.style.backgroundColor=match ? this._highlightBackground : '';\r
-    gridCell.innerHTML=this._format(v);\r
-  }\r
-}
-
-
 Rico.TableColumn.bgColor = function() {
 }
 
@@ -286,14 +221,15 @@ Rico.TableColumn.link.prototype = {
   },
 
   _create: function(gridCell,windowRow) {
-    this._anchors[windowRow]=Rico.createFormField(gridCell,'a',null,this.liveGrid.tableId+'_a_'+this.index+'_'+windowRow);
-    if (this._target) this._anchors[windowRow].target=this._target;
-    this._clear(gridCell,windowRow);
+    var a = gridCell.appendChild(document.createElement('a'));
+    if (this._target) a.target=this._target;
+    a.href='';
+    a.innerHTML=Rico.isIE ? '&nbsp;' : '';
+    this._anchors[windowRow] = a;
   },
 
   _clear: function(gridCell,windowRow) {
-    this._anchors[windowRow].href='';
-    this._anchors[windowRow].innerHTML='';
+    this._anchors[windowRow].style.display='none';
   },
 
   _display: function(v,gridCell,windowRow) {
@@ -308,6 +244,7 @@ Rico.TableColumn.link.prototype = {
     if (href && desc) {
       this._anchors[windowRow].href=href;
       this._anchors[windowRow].innerHTML=desc;
+      this._anchors[windowRow].style.display=Rico.isIE ? 'inline-block' : '';
     } else {
       this._clear(gridCell,windowRow);
     }