}
-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() {
}
},
_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 ? ' ' : '';
+ 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) {
if (href && desc) {
this._anchors[windowRow].href=href;
this._anchors[windowRow].innerHTML=desc;
+ this._anchors[windowRow].style.display='';
} else {
this._clear(gridCell,windowRow);
}