jsm

net/sf/jsm/table/jsmTh.js

Summary

No overview generated for 'net/sf/jsm/table/jsmTh.js'


Class Summary
JsmTh A table header cell

/**
 * A table header cell
 * @extends JsmCell
 * @class A table header cell
 * @param value Optional: The value
 * @param title Optional: The title 
 * @constructor
 */       
  function JsmTh(value, title) {
    /** @ignore */   
  	this.id=new Date().getTime() + "" + Math.random();  	 
  	logger.info("Created JsmTh with id: " + this.id);  	
    /** @ignore */      	    
    this.value = jsm.noud(value)?"":value;
    /** @ignore */   
    this.title = jsm.noud(title)?value:title;    	
    /** defaults to 'jsmOnTableHeaderClick' */       
    this.onClickFunctionName = "jsmOnTableHeaderClick";
  } 
  JsmTh.extendClass(JsmCell);
  /** @ignore */    
  JsmTh.prototype.className="JsmTh"; 
  
  /** Get the node object; the model (this) will be attached to the node as property 'model'
  * @return The created node object
  */       
  JsmTh.prototype.getNode = function() {
  	var th = document.createElement("th"); 
  	th.setAttribute("id", this.id);
  	th.model=this;
  	this.addAttributesToViewComponent(th);  	  	
  	th.onclick=_jsmOnClickEventDelegate;
  	var onMouseDownFunctionDefinition = "";
  	th.onmousedown=_jsmOnMouseDownEventDelegate;  
  	this.setAttribute("onmousedown", "if (!e) e=window.event; jsm.resizeColumn=" + this.getIndex() + "; jsm.resize=true; jsm.resizeStartX=e.screenX;");  		  	 
	th.onmouseup=_jsmOnMouseUpEventDelegate;
	this.setAttribute("onmouseup", "jsm.resize=false; jsm.resizeColumn=-1; jsm.resizeOriginalWidth=-1;");	
  	th.setAttribute("title", this.title); 
  	if (this.idx == this.tr.table.getSortColumn()) {
	  	th.innerHTML = this.value + " <img src='" + (this.tr.table.getSortOrder()=='desc'?jsmSortDescImage:jsmSortAscImage) + "' border='0'></img>";  	 	
  	} else {
		th.innerHTML = this.value;  	 	  	
  	}
  	return th;
  }  
    

jsm

Documentation generated by JSDoc on Tue Sep 26 08:42:57 2006