[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

/template/lib/mootools/more/Interface/ -> HtmlTable.js (source)

   1  var HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:"HtmlTable",initialize:function(){var a=Array.link(arguments,{options:Object.type,table:Element.type});this.setOptions(a.options);this.element=a.table||new Element("table",this.options.properties);if(this.occlude()){return this.occluded}this.build()},build:function(){this.element.store("HtmlTable",this);this.body=document.id(this.element.tBodies[0])||new Element("tbody").inject(this.element);$$(this.body.rows);if(this.options.headers.length){this.setHeaders(this.options.headers)}else{this.thead=document.id(this.element.tHead)}if(this.thead){this.head=document.id(this.thead.rows[0])}if(this.options.footers.length){this.setFooters(this.options.footers)}this.tfoot=document.id(this.element.tFoot);if(this.tfoot){this.foot=document.id(this.tfoot.rows[0])}this.options.rows.each(function(a){this.push(a)},this);["adopt","inject","wraps","grab","replaces","dispose"].each(function(a){this[a]=this.element[a].bind(this.element)},this)},toElement:function(){return this.element},empty:function(){this.body.empty();return this},set:function(d,a){var c=(d=="headers")?"tHead":"tFoot";this[c.toLowerCase()]=(document.id(this.element[c])||new Element(c.toLowerCase()).inject(this.element,"top")).empty();var b=this.push(a,{},this[c.toLowerCase()],d=="headers"?"th":"td");if(d=="headers"){this.head=document.id(this.thead.rows[0])}else{this.foot=document.id(this.thead.rows[0])}return b},setHeaders:function(a){this.set("headers",a);return this},setFooters:function(a){this.set("footers",a);return this},push:function(e,b,d,a){if($type(e)=="element"&&e.get("tag")=="tr"){e.inject(d||this.body);return{tr:e,tds:e.getChildren("td")}}var c=e.map(function(h){var i=new Element(a||"td",h?h.properties:{}),g=(h?h.content:"")||h,f=document.id(g);if($type(g)!="string"&&f){i.adopt(f)}else{i.set("html",g)}return i});return{tr:new Element("tr",b).inject(d||this.body).adopt(c),tds:c}}});


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1