net/sf/jsm/table/jsmActionCell.js
Summary
No overview generated for 'net/sf/jsm/table/jsmActionCell.js'
function JsmActionCell(value, title) {
this.id=new Date().getTime() + "" + Math.random();
logger.info("Created JsmActionCell with id: " + this.id);
this.value = jsm.noud(value)?"":value;
this.title = jsm.noud(title)?value:title;
}
JsmActionCell.extendClass(JsmCell);
JsmActionCell.prototype.className="JsmActionCell";
JsmActionCell.prototype.init = function(table, rowIdx, columnIdx) {
return this;
}
JsmActionCell.prototype.getNode = function(specialClassName, jsmRowType) {
if (!jsm.noud(jsmRowType) && jsmRowType == 'header') {
var cell = document.createElement("th");
} else {
var cell = document.createElement("td");
}
cell.setAttribute("id", this.id);
cell.model=this;
this.addAttributesToViewComponent(cell);
if (jsm.noud(jsmRowType) || jsmRowType != 'header') {
if (jsm.noud(this.getAttribute('class'))) {
cell.className=(this.tr.table._nodeIterationCounter%2==0?'jsmEven':'jsmOdd');
} else {
cell.className=this.getAttribute('class') + (this.tr.table._nodeIterationCounter%2==0?' jsmEven':' jsmOdd');
}
}
cell.onclick=_jsmOnClickEventDelegate;
cell.onmousedown=_jsmOnMouseDownEventDelegate;
cell.onmouseup=_jsmOnMouseUpEventDelegate;
cell.setAttribute("title", this.title);
if (typeof this.value == 'string') {
if (this.value.indexOf('%{') == 0) {
var expression = this.value.substring(2, this.value.length-1);
cell.innerHTML=eval(expression);
} else {
cell.innerHTML = this.value;
}
}
if (typeof this.value == 'object') {
cell.appendChild(this.value.getNode());
}
return cell;
}
JsmActionCell.prototype.clone = function() {
var clonedActionCell = new JsmActionCell();
clonedActionCell._attributes = this._attributes;
clonedActionCell._metaData = this._metaData;
clonedActionCell.init=this.init;
clonedActionCell.value = this.value;
clonedActionCell.title = this.title;
clonedActionCell.onClickFunctionName = this.onClickFunctionName;
return clonedActionCell;
}
Documentation generated by
JSDoc on Tue Sep 26 08:42:57 2006