/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add("datatable-base",function(C){var W=C.Lang,G=W.isValue,g=C.Lang.substitute,D=C.Node,T=D.create,P=C.ClassNameManager.getClassName,Q="datatable",R="column",i="focus",l="keydown",H="mouseenter",O="mouseleave",K="mouseup",a="mousedown",d="click",V="dblclick",E=P(Q,"columns"),c=P(Q,"data"),B=P(Q,"msg"),L=P(Q,"liner"),f=P(Q,"first"),I=P(Q,"last"),U=P(Q,"even"),b=P(Q,"odd"),e="
",X="",j='',F='',k='
{value}
',h='',A='
{value}
',J="{value}",N='';function M(Y){M.superclass.constructor.apply(this,arguments);}C.mix(M,{NAME:"column",ATTRS:{id:{valueFn:"_defaultId",readOnly:true},key:{valueFn:"_defaultKey"},field:{valueFn:"_defaultField"},label:{valueFn:"_defaultLabel"},children:{value:null},abbr:{value:""},classnames:{readOnly:true,getter:"_getClassnames"},formatter:{},sortable:{value:false},editor:{},width:{},resizeable:{},minimized:{},minWidth:{},maxAutoWidth:{}}});C.extend(M,C.Widget,{_defaultId:function(){return C.guid();},_defaultKey:function(Y){return Y||C.guid();},_defaultField:function(Y){return Y||this.get("key");},_defaultLabel:function(Y){return Y||this.get("key");},_afterAbbrChange:function(Y){this._uiSetAbbr(Y.newVal);},keyIndex:null,headers:null,colSpan:1,rowSpan:1,parent:null,thNode:null,initializer:function(Y){},destructor:function(){},_getClassnames:function(){return C.ClassNameManager.getClassName(R,this.get("id"));},syncUI:function(){this._uiSetAbbr(this.get("abbr"));},_uiSetAbbr:function(Y){this.thNode.set("abbr",Y);}});C.Column=M;function Z(Y){Z.superclass.constructor.apply(this,arguments);}C.mix(Z,{NAME:"columnset",ATTRS:{definitions:{setter:"_setDefinitions"}}});C.extend(Z,C.Base,{_setDefinitions:function(Y){return C.clone(Y);},tree:null,idHash:null,keyHash:null,keys:null,initializer:function(){var Y=[],q={},r={},p=[],o=this.get("definitions"),m=this;function n(z,y,x){var u=0,t=y.length,w,v,s;z++;if(!Y[z]){Y[z]=[];}for(;uq){q=w;}}}}}for(n=0;n"];for(;m");this._colgroupNode=n.insertBefore(T(o.join("")),n.get("firstChild")); return this._colgroupNode;},_addTheadNode:function(Y){if(Y){this._theadNode=Y.insertBefore(T(j),this._colgroupNode.next());return this._theadNode;}},_addTbodyNode:function(Y){this._tbodyNode=Y.appendChild(T(F));return this._tbodyNode;},_addMessageNode:function(Y){this._msgNode=Y.insertBefore(T(N),this._tbodyNode);return this._msgNode;},_addCaptionNode:function(Y){this._captionNode=Y.createCaption();return this._captionNode;},bindUI:function(){var m="thead."+E+">tr>th",n="tbody."+c+">tr>td",Y="tbody."+B+">tr>td";},delegate:function(Y){if(Y==="dblclick"){this.get("boundingBox").delegate.apply(this.get("boundingBox"),arguments);}else{this.get("contentBox").delegate.apply(this.get("contentBox"),arguments);}},syncUI:function(){this._uiSetColumnset(this.get("columnset"));this._uiSetRecordset(this.get("recordset"));this._uiSetSummary(this.get("summary"));this._uiSetCaption(this.get("caption"));},_uiSetSummary:function(Y){Y=G(Y)?Y:"";this._tableNode.set("summary",Y);},_uiSetCaption:function(Y){Y=G(Y)?Y:"";this._captionNode.setContent(Y);},_uiSetColumnset:function(p){var m=p.tree,r=this._theadNode,n=0,Y=m.length,o=r.get("parentNode"),q=r.next();r.remove();r.get("children").remove(true);for(;n