熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

一個以Javascript+xml的樹型列表

2022-06-13   來源: JSP教程 
 這是在網站下載的一個以Javascript+xml的樹型列表這個列表界面非常的漂亮但是由於裡面內容比較復雜而現在項目需要用到這個列表我到現在還沒有摸清怎麼在裡面讓點擊一個樹型的項目轉到別的網頁裡面去希望有興趣的朋友一起研究一下
部分代碼如下
 <script>
 
function dtmlXMLLoaderObject(funcObjectdhtmlObject){
 thisxmlDoc=;
 thisonloadAction=funcObject||null;
 thismainObject=dhtmlObject||null;
 return this;
};
 
 dtmlXMLLoaderObjectprototypewaitLoadFunction=function(dhtmlObject){
 thischeck=function(){
 if(!dhtmlObjectxmlDocreadyState)dhtmlObjectonloadAction(dhtmlObjectmainObject);
 else{
 if(dhtmlObjectxmlDocreadyState != )return false;
 else dhtmlObjectonloadAction(dhtmlObjectmainObject);}
};
 return thischeck;
};
 
 
 dtmlXMLLoaderObjectprototypegetXMLTopNode=function(tagName){
 if(thisxmlDocresponseXML){var temp=thisxmlDocresponseXMLgetElementsByTagName(tagName);
var z=temp[];}
 else var z=thisxmlDocdocumentElement;
 if(z)return z;
 alert(Incorrect XML);
 return documentcreateElement(DIV);
};
 
 
 dtmlXMLLoaderObjectprototypeloadXMLString=function(xmlString){
 try 
{
 var parser = new DOMParser();
 thisxmlDoc = parserparseFromString(xmlStringtext/xml);
}
 catch(e){
 thisxmlDoc = new ActiveXObject(MicrosoftXMLDOM);
 thisxmlDocloadXML(xmlString);
}
 thisonloadAction(thismainObject);
}
 dtmlXMLLoaderObjectprototypeloadXML=function(filePath){
 try 
{
 thisxmlDoc = new XMLHttpRequest();
 thisxmlDocopen(GETfilePathtrue);
 thisxmlDoconreadystatechange=new thiswaitLoadFunction(this);
 thisxmlDocsend(null);
}
 catch(e){
 if(documentimplementation && documentimplementationcreateDocument)
{
 thisxmlDoc = documentimplementationcreateDocument(null);
 thisxmlDoconload = new thiswaitLoadFunction(this);
}
 else
{
 thisxmlDoc = new ActiveXObject(MicrosoftXMLDOM);
 thisxmlDocasync=true;
 thisxmlDoconreadystatechange=new thiswaitLoadFunction(this);
}
 thisxmlDocload(filePath);
}
};
 
 
function callerFunction(funcObjectdhtmlObject){
 thishandler=function(e){
 if(!e)e=event;
 funcObject(edhtmlObject);
 return true;
};
 return thishandler;
};

function getAbsoluteLeft(htmlObject){
 var xPos = htmlObjectoffsetLeft;
 var temp = htmlObjectoffsetParent;
 while(temp != null){
 xPos+= tempoffsetLeft;
 temp = tempoffsetParent;
}
 return xPos;
}
 
function getAbsoluteTop(htmlObject){
 var yPos = htmlObjectoffsetTop;
 var temp = htmlObjectoffsetParent;
 while(temp != null){
 yPos+= tempoffsetTop;
 temp = tempoffsetParent;
}
 return yPos;
}
 
 
 
function convertStringToBoolean(inputString){if(typeof(inputString)==string)inputString=
inputStringtoLowerCase();
 switch(inputString){
 case :
 case true:
 case yes:
 case y:
 case 
 case true: 
 return true;
 break;
 default: return false;
}
}

function getUrlSymbol(str){
 if(strindexOf(?)!=)
 return &
 else
 return ?
}
 
 
function dhtmlDragAndDropObject(){
 thislastLanding=;
 thisdragNode=;
 thisdragStartNode=;
 thisdragStartObject=;
 thistempDOMU=null;
 thistempDOMM=null;
 thiswaitDrag=;
 if(windowdhtmlDragAndDrop)return windowdhtmlDragAndDrop;
 windowdhtmlDragAndDrop=this;
 return this;
};
 
 dhtmlDragAndDropObjectprototyperemoveDraggableItem=function(htmlNode){
 htmlNodeonmousedown=null;
 htmlNodedragStarter=null;
 htmlNodedragLanding=null;
}
 dhtmlDragAndDropObjectprototypeaddDraggableItem=function(htmlNodedhtmlObject){
 htmlNodeonmousedown=thispreCreateDragCopy;
 htmlNodedragStarter=dhtmlObject;
 thisaddDragLanding(htmlNodedhtmlObject);
}
 dhtmlDragAndDropObjectprototypeaddDragLanding=function(htmlNodedhtmlObject){
 htmlNodedragLanding=dhtmlObject;
}
 dhtmlDragAndDropObjectprototypepreCreateDragCopy=function(e)
{
 if(windowdhtmlDragAndDropwaitDrag){
 windowdhtmlDragAndDropwaitDrag=;
 documentbodyonmouseup=windowdhtmlDragAndDroptempDOMU;
 documentbodyonmousemove=windowdhtmlDragAndDroptempDOMM;
 return;
}
 
 windowdhtmlDragAndDropwaitDrag=;
 windowdhtmlDragAndDroptempDOMU=documentbodyonmouseup;
 windowdhtmlDragAndDroptempDOMM=documentbodyonmousemove;
 windowdhtmlDragAndDropdragStartNode=this;
 windowdhtmlDragAndDropdragStartObject=thisdragStarter;
 documentbodyonmouseup=windowdhtmlDragAndDroppreCreateDragCopy;
 documentbodyonmousemove=windowdhtmlDragAndDropcallDrag;
};
 dhtmlDragAndDropObjectprototypecallDrag=function(e){
 if(!e)e=windowevent;
 dragger=windowdhtmlDragAndDrop;
 if(!draggerdragNode){
 draggerdragNode=draggerdragStartObject_createDragNode(draggerdragStartNode);
 documentbodyappendChild(draggerdragNode);
 documentbodyonmouseup=draggerstopDrag;
 draggerwaitDrag=;
}
 draggerdragNodestyleleft=eclientX++documentbodyscrollLeft;draggerdragNodestyletop=
eclientY++documentbodyscrollTop;
 if(!esrcElement)var z=etarget;else z=esrcElement;
 draggercheckLanding(z);
}
 dhtmlDragAndDropObjectprototypecheckLanding=function(htmlObject){
 if(htmlObjectdragLanding){if(thislastLanding)thislastLandingdragLanding_dragOut(thislastLanding);
 thislastLanding=htmlObject;thislastLanding=thislastLandingdragLanding_dragIn(thislastLandingthisdragStartNode);}
 else{
 if(htmlObjecttagName!=BODY)thischeckLanding(htmlObjectparentNode);
 else{if(thislastLanding)thislastLandingdragLanding_dragOut(thislastLanding);thislastLanding=;}
}
}
 dhtmlDragAndDropObjectprototypestopDrag=function(e){
 dragger=windowdhtmlDragAndDrop;
 if(draggerlastLanding)draggerlastLandingdragLanding_drag(draggerdragStartNodedraggerdragStartObjectdraggerlastLanding);
 draggerlastLanding=;
 draggerdragNodeparentNoderemoveChild(draggerdragNode);
 draggerdragNode=;
 draggerdragStartNode=;
 draggerdragStartObject=;
 documentbodyonmouseup=draggertempDOMU;
 documentbodyonmousemove=draggertempDOMM;
 draggertempDOMU=null;
 draggertempDOMM=null;
 draggerwaitDrag=;
}
 
 </script>
 <! dhtmlXTreejs >
 <script>
 

function dhtmlXTreeObject(htmlObjectwidthheightrootId){
 if(typeof(htmlObject)!=object)
 thisparentObject=documentgetElementById(htmlObject);
 else
 thisparentObject=htmlObject;
 thismytype=tree;
 thiswidth=width;
 thisheight=height;
 thisrootId=rootId;
 
 thisstyle_pointer=pointer;
 if(navigatorappName == Microsoft Internet Explorer)thisstyle_pointer=hand;
 
 thishfMode=;
 thisnodeCut=;
 thisXMLsource=;
 thisXMLloadingWarning=;
 this_globalIdStorage=new Array();
 thisglobalNodeStorage=new Array();
 this_globalIdStorageSize=;
 thistreeLinesOn=true;
 thischeckFuncHandler=;
 thisopenFuncHandler=;
 thisdblclickFuncHandler=;
 thistscheck=false;
 thistimgen=true;
 
 thisimPath=treeGfx/;
 thischeckArray=new Array(iconUnCheckAllgificonCheckAllgificonCheckGraygif);
 thislineArray=new Array(linegiflinegiflinegifblankgifblankgif);
 thisminusArray=new Array(minusgifminusgifminusgifminusgifminusgif);
 thisplusArray=new Array(plusgifplusgifplusgifplusgifplusgif);
 thisimageArray=new Array(leafgiffolderOpengiffolderClosedgif);
 thiscutImg= new Array();
 thiscutImage=but_cutgif;
 
 thisdragger= new dhtmlDragAndDropObject();
 lNode=new dhtmlXTreeItemObject(thisrootIdthis);
 lNodechildNodes[]childNodes[]styledisplay=none;
 lNodechildNodes[]childNodes[]childNodes[]className=hiddenRow;
 thisallTree=this_createSelf();
 thisallTreeappendChild(lNode);
 thisallTreeonselectstart=new Function(return false;);
 thisXMLLoader=new dtmlXMLLoaderObject(this_parseXMLTreethis);
 
 thisdraggeraddDragLanding(thisallTreethis);
 return this;
};

function dhtmlXTreeItemObject(itemIditemTextparentObjecttreeObjectactionHandlermode){
 lNode=;
 thisacolor=;
 thisscolor=;
 thistr=;
 thischildsCount=;
 thistempDOMM=;
 thistempDOMU=;
 thisdragSpan=;
 thisdragMove=;
 thisspan=;
 thiscloseble=;
 thischildNodes=new Array();
 thischeckstate=;
 thistreeNod=treeObject;
 thislabel=itemText;
 thisparentObject=parentObject;
 thisactionHandler=actionHandler;
 thisimages=new Array(treeObjectimageArray[]treeObjectimageArray[]treeObjectimageArray[]);

 thisid=treeObject_globalIdStorageAdd(itemIdthis);
 if(thistreeNodcheckBoxOff)lNode=thistreeNod_createItem(thismode);
 else lNode=thistreeNod_createItem(thismode);
 lNodeobjBelong=this;
 return this;
};
 
 
 
 dhtmlXTreeObjectprototype_globalIdStorageAdd=function(itemIditemObject){
 if(this_globalIdStorageFind(itemId)){d=new Date();itemId=dvalueOf()+_+itemId;return this_globalI
dStorageAdd(itemIditemObject);}
 this_globalIdStorage[this_globalIdStorageSize]=itemId;
 thisglobalNodeStorage[this_globalIdStorageSize]=itemObject;
 this_globalIdStorageSize++;
 return itemId;
};
 
 dhtmlXTreeObjectprototype_globalIdStorageSub=function(itemId){
 for(var i=;i<this_globalIdStorageSize;i++)
 if(this_globalIdStorage[i]==itemId)
{
 this_globalIdStorage[i]=this_globalIdStorage[this_globalIdStorageSize];
 thisglobalNodeStorage[i]=thisglobalNodeStorage[this_globalIdStorageSize];
 this_globalIdStorageSize;
 this_globalIdStorage[this_globalIdStorageSize]=;
 thisglobalNodeStorage[this_globalIdStorageSize]=;
}
};
 
 
 dhtmlXTreeObjectprototype_globalIdStorageFind=function(itemId){
 for(var i=;i<this_globalIdStorageSize;i++)
 if(this_globalIdStorage[i]==itemId)
 return thisglobalNodeStorage[i];
 return ;
};

 
 
 dhtmlXTreeObjectprototype_drawNewTr=function(htmlObject)
{
 var tr =documentcreateElement(tr);
 var td=documentcreateElement(td);
 var td=documentcreateElement(td);
 tdappendChild(documentcreateTextNode());
 lSpan=;tdappendChild(htmlObject);trappendChild(td);trappendChild(td);
 return tr;
};
 
 dhtmlXTreeObjectprototypeloadXMLString=function(xmlString){thisXMLLoaderloadXMLString(xmlString);};
 
 dhtmlXTreeObjectprototypeloadXML=function(file){thisXMLLoaderloadXML(file);};
 
 dhtmlXTreeObjectprototype_attachChildNode=function(parentObjectitemIditemTextitemActionHandlerimageimageimageoptionStrchildsurlbeforeNode){
 if(beforeNode)parentObject=beforeNodeparentObject;
 if(((parentObjectXMLload==)&&(thisXMLsource))&&(!thisXMLloadingWarning))
{
 parentObjectXMLload=;thisloadXML(thisXMLsource+getUrlSymbol(thisXMLsource)+itemId=+escape(emId));
}
 
 var Count=parentObjectchildsCount;
 var Nodes=parentObjectchildNodes;
 
 if((!itemActionHandler)&&(thisaFunc))itemActionHandler=thisaFunc;
 Nodes[Count]=new dhtmlXTreeItemObject(itemIditemTextparentObjectthisitemActionHandler);
 
 if(image)Nodes[Count]images[]=image;
 if(image)Nodes[Count]images[]=image;
 if(image)Nodes[Count]images[]=image;
 
 parentObjectchildsCount++;
 var tr=this_drawNewTr(Nodes[lNode);
 if(thisXMLloadingWarning)
 Nodes[lNodeparentNodeparentNodestyledisplay=none;
 
 if(optionStr){
 var tempStr=optionStrsplit();
 for(var i=;i<tempStrlength;i++)
{
 switch(tempStr[i])
{
 case TOP: if(parentObjectchildsCount>)beforeNode=lNodechildNodes[]childNodes[]nodempreviousSibling;break;
}
};
};
 
 if((beforeNode)&&(beforeNodetrnextSibling))
 lNodechildNodes[]insertBefore(trbeforeNodetrnextSibling);
 else
 lNodechildNodes[]appendChild(tr);
 if(thisXMLsource)if((childs)&&(childs!=))Nodes[Count]XMLload=;else Nodes[Count]XMLload=;
 Nodes[Count]tr=tr;
 trnodem=Nodes[Count];
 if(emId==)
 trchildNodes[]className=hitemIddenRow;
 
 if(optionStr){
 var tempStr=optionStrsplit();
 for(var i=;i<tempStrlength;i++)
{
 switch(tempStr[i])
{
 case SELECT: thisselectItem(itemIdfalse);break;
 case CALL: thisselectItem(itemIdtrue);break;
 case CHILD: Nodes[Count]XMLload=;break;
 case CHECKED
 if(thisXMLloadingWarning)
 thissetCheckList+=itemId;
 else
 thissetCheck(itemId);
 break;
 case OPEN: Nodes[Count]openMe=;break;
}
};
};
 if(!thisXMLloadingWarning)
{
 if(this_getOpenState(parentObject)<)
 thisopenItem(parentObjectid);
 
 if(beforeNode)
{
 this_correctPlus(beforeNode);
 this_correctLine(beforeNode);
}
 this_correctPlus(parentObject);
 this_correctLine(parentObject);
 this_correctPlus(Nodes[Count]);
 if(parentObjectchildsCount>=)
{
 this_correctPlus(Nodes[parentObjectchildsCount]);
 this_correctLine(Nodes[parentObjectchildsCount]);
}
 if(parentObjectchildsCount!=)this_correctPlus(Nodes[]);
 if(thistscheck)this_correctCheckStates(parentObject);
}
 
 return Nodes[Count];
};

 dhtmlXTreeObjectprototypeinsertNewItem=function(parentIditemIditemTextitemActionHandlerimageimageimageoptionStrchildsurl){
 var parentObject=this_globalIdStorageFind(parentId);
 if(!parentObject)return();
 return this_attachChildNode(parentObjectitemIditemTextitemActionHandlerimageimageimageoptionStrchildsurl);
};
 
 dhtmlXTreeObjectprototype_parseXMLTree=function(dhtmlObjectnodeparentIdlevel){
 dhtmlObjectXMLloadingWarning=;
 var nodeAskingCall=;
 if(!node){
 node=dhtmlObjectXMLLoadergetXMLTopNode(tree);
 parentId=nodegetAttribute(id);
 dhtmlObjectsetCheckList=;
}
 for(var i=;i<nodechildNodeslength;i++)
{
 if((nodechildNodes[i]nodeType==)&&(nodechildNodes[i]tagName == item))
{
 var name=nodechildNodes[i]getAttribute(text);
 var cId=nodechildNodes[i]getAttribute(id);
 
 var im=nodechildNodes[i]getAttribute(im);
 var im=nodechildNodes[i]getAttribute(im);
 var im=nodechildNodes[i]getAttribute(im);
 
 var aColor=nodechildNodes[i]getAttribute(aCol);
 var sColor=nodechildNodes[i]getAttribute(sCol);
 
 var chd=nodechildNodes[i]getAttribute(child);
 
 var atop=nodechildNodes[i]getAttribute(top);
 var aopen=nodechildNodes[i]getAttribute(open);
 var aselect=nodechildNodes[i]getAttribute(select);
 var acall=nodechildNodes[i]getAttribute(call);
 var achecked=nodechildNodes[i]getAttribute(checked);
 var closeable=nodechildNodes[i]getAttribute(closeable);
 var url=nodechildNodes[i]getAttribute(url);
 var zST=;
 if(aselect)zST+=SELECT;
 if(atop)zST+=TOP;
 if(acall)nodeAskingCall=cId;
 if(achecked)zST+=CHECKED;
 if((aopen)&&(aopen!=))zST+=OPEN;
 
 var temp=dhtmlObject_globalIdStorageFind(parentId);
 tempXMLload=;
 dhtmlObjectinsertNewItem(parentIdcIdnameimimimzSTchdurl);
 if(dhtmlObjectparserExtension)dhtmlObjectparserExtension_parseExtension(nodechildNodes[i]dhtmlObjectparserExtensioncIdparentId);
 dhtmlObjectsetItemColor(cIdaColorsColor);
 if((closeable==)||(closeable==))dhtmlObjectsetItemCloseable(cIdcloseable);
 var zcall=dhtmlObject_parseXMLTree(dhtmlObjectnodechildNodes[i]cId);
 if(zcall!=)nodeAskingCall=zcall;
}
 else
 if((nodechildNodes[i]nodeType==)&&(nodechildNodes[i]tagName == userdata))
{
 var name=nodechildNodes[i]getAttribute(name);
 if((name)&&(nodechildNodes[i]childNodes[])){
 dhtmlObjectsetUserData(parentIdnamenodechildNodes[i]childNodes[]data);
};
};
};
 if(!level){
 dhtmlObjectlastLoadedXMLId=parentId;
 dhtmlObject_redrawFrom(dhtmlObject);
 dhtmlObjectXMLloadingWarning=;
 var chArr=dhtmlObjectsetCheckListsplit();
 for(var n=;n<chArrlength;n++)
 if(chArr[n])dhtmlObjectsetCheck(chArr[n]);
 if(nodeAskingCall!=)dhtmlObjectselectItem(nodeAskingCalltrue);
}
 return nodeAskingCall;
};
 
 
 dhtmlXTreeObjectprototype_redrawFrom=function(dhtmlObjectitemObject){
 if(!itemObject){
 var tempx=dhtmlObject_globalIdStorageFind(dhtmlObjectlastLoadedXMLId);
 dhtmlObjectlastLoadedXMLId=;
 if(!tempx)return ;
}
 else tempx=itemObject;
 for(var i=;i<tempxchildsCount;i++)
{
 if(!itemObject)tempxchildNodes[lNodeparentNodeparentNodestyledisplay=;
 if(tempxchildNodes[i]openMe==)
 for(var zy=;zy<tempxchildNodes[i]childNodeslength;zy++)
 tempxchildNodes[lNodechildNodes[]childNodes[zy+]styledisplay=;
 dhtmlObject_redrawFrom(dhtmlObjecttempxchildNodes[i]);
 dhtmlObject_correctLine(tempxchildNodes[i]);
 dhtmlObject_correctPlus(tempxchildNodes[i]);
};
 dhtmlObject_correctLine(tempx);
 dhtmlObject_correctPlus(tempx);
};

 dhtmlXTreeObjectprototype_createSelf=function(){
 var div=documentcreateElement(div);
 divclassName=containerTableStyle;
 divstylewidth=thiswidth;
 divstyleheight=thisheight;
 thisparentObjectappendChild(div);
 return div;
};

 dhtmlXTreeObjectprototype_xcloseAll=function(itemObject)
{
 if(thisrootId!=itemObjectid)this_HideShow(itemObject);
 for(var i=;i<itemObjectchildsCount;i++)
 this_xcloseAll(itemObjectchildNodes[i]);
};
 
 dhtmlXTreeObjectprototype_xopenAll=function(itemObject)
{
 this_HideShow(itemObject);
 for(var i=;i<itemObjectchildsCount;i++)
 this_xopenAll(itemObjectchildNodes[i]);
};
 
 dhtmlXTreeObjectprototype_correctPlus=function(itemObject){
 var workArray=thislineArray;
 if((thisXMLsource)&&(!itemObjectXMLload))
{
 var workArray=thisplusArray;
 lNodechildNodes[]childNodes[]childNodes[]childNodes[]src=thisimPath+itemO
bjectimages[];
}
 else
try{
 if(itemObjectchildsCount)
{
 if(lNodechildNodes[]childNodes[]styledisplay!=none)
{
 var workArray=thisminusArray;
 lNodechildNodes[]childNodes[]childNodes[]childNodes[]src=thisimPath+itemO
bjectimages[];
}
 else
{
 var workArray=thisplusArray;
 lNodechildNodes[]childNodes[]childNodes[]childNodes[]src=thisimPath+itemO
bjectimages[];
}
}
 else
{
 lNodechildNodes[]childNodes[]childNodes[]childNodes[]src=thisimPath+itemO
bjectimages[];
}
}
 catch(e){};
 
 var tempNum=;
 if(!itemObjecttreeNodtreeLinesOn)lNodechildNodes[]childNodes[]childNodes[]
childNodes[]src=thisimPath+workArray[];
 else{
 if(itemObjectparentObject)tempNum=this_getCountStatus(itemObjectiditemObjectparentObject);
 lNodechildNodes[]childNodes[]childNodes[]childNodes[]src=thisimPath+workArray[tempNum];
}
};
 
 dhtmlXTreeObjectprototype_correctLine=function(itemObject){
 var sNode=itemObjectparentObject;
 try{
 if(sNode)
 if((this_getLineStatus(itemObjectidsNode)==)||(!thistreeLinesOn))
{
 for(var i=;i<=itemObjectchildsCount;i++)
{
 lNodechildNodes[]childNodes[i]childNodes[]stylebackgroundImage=;
 lNodechildNodes[]childNodes[i]childNodes[]stylebackgroundRepeat=;
}
}
 else
 for(var i=;i<=itemObjectchildsCount;i++)
{
 lNodechildNodes[]childNodes[i]childNodes[]stylebackgroundImage=url(+thisimPath+linegif);
 lNodechildNodes[]childNodes[i]childNodes[]stylebackgroundRepeat=repeaty;
}
}
 catch(e){};
};
 
 dhtmlXTreeObjectprototype_getCountStatus=function(itemIditemObject){
 try{
 if(itemObjectchildsCount<=){if(itemObjectid==thisrootId)return ;else return ;}
 
 if(lNodechildNodes[]childNodes[]nodemid==itemId)if(!itemObjectid)return ;else return ;
 if(lNodechildNodes[]childNodes[itemObjectchildsCount]nodemid==itemId)return ;
}
 catch(e){};
 return ;
};
 
 dhtmlXTreeObjectprototype_getLineStatus =function(itemIditemObject){
 if(lNodechildNodes[]childNodes[itemObjectchildsCount]nodemid==itemId)return ;
 return ;
}

 dhtmlXTreeObjectprototype_HideShow=function(itemObjectmode){
 if(((thisXMLsource)&&(!itemObjectXMLload))&&(!mode)){itemObjectXMLload=;thisloadXML(thisXMLsource+getUrlSymbol(thisXMLsource)+id=+escape(itemObjectid));return;};
 var Nodes=lNodechildNodes[]childNodes;var Count=Nodeslength;
 if(Count>){
 if(((Nodes[]styledisplay!=none)||(mode==))&&(mode!=))node;else node;
 for(var i=;i<Count;i++)
 Nodes[i]styledisplay=nodestyle;
}
 this_correctPlus(itemObject);
}
 
 dhtmlXTreeObjectprototype_getOpenState=function(itemObject){
 var z=lNodechildNodes[]childNodes;
 if(zlength<=)return ;
 if(z[]styledisplay!=none)return ;
 else return ;
}

 
 
 dhtmlXTreeObjectprototypeonRowClick=function(){
 if(thisparentObjecttreeNoddblclickFuncHandler)if(!thisparentObjecttreeNoddblclickFuncHandler(thisparentObjectid))return ;
 if((thisparentObjectcloseble)&&(thisparentObjectcloseble!=))
 thisparentObjecttreeNod_HideShow(thisparentObject);
 else
 thisparentObjecttreeNod_HideShow(thisparentObject);
};
 
 dhtmlXTreeObjectprototypeonRowClick=function(){
 if(thisparentObjecttreeNodopenFuncHandler)if(!thisparentObjecttreeNodopenFuncHandler(thisparentObjectidthisparentObjecttreeNod_getOpenState(thisparentObject)))return ;
 if((thisparentObjectcloseble)&&(thisparentObjectcloseble!=))
 thisparentObjecttreeNod_HideShow(thisparentObject);
 else
 thisparentObjecttreeNod_HideShow(thisparentObject);
};
 
 
 dhtmlXTreeObjectprototypeonRowSelect=function(ehtmlObjectmode){
 if(!htmlObject)htmlObject=this;
 htmlObjectchildNodes[]className=selectedTreeRow;
 if(htmlObjectparentObjectscolor)htmlObjectparentOlor=htmlObjectparentObjectscolor;
 if((htmlObjectparentObjecttreeNodlastSelected)&&(htmlObjectparentObjecttreeNodlastSelected!=
htmlObject))
{
 htmlObjectparentObjecttreeNodlastSelectedchildNodes[]className=standartTreeRow;
 if(htmlObjectparentObjecttreeNodlastSelectedparentObjectacolor)htmlObjectparentObjecttreeNodlastSelectedparentOlor=htmlObjectparentObjecttreeNod
lastSelectedparentObjectacolor;
}
 htmlObjectparentObjecttreeNodlastSelected=htmlObject;
 if(!mode){if(htmlObjectparentObjectactionHandler)htmlObjectparentObjectactionHandler(htmlObjectparentObjectid);}
};
 


 
dhtmlXTreeObjectprototype_correctCheckStates=function(dhtmlObject){
 if(!thistscheck)return;
 if(dhtmlObjectid==thisrootId)return;
 var act=lNodechildNodes[]childNodes;
 var flag=;var flag=;
 if(actlength<)return;
 for(var i=;i<actlength;i++)
 if(act[i]nodemcheckstate==)flag=;
 else if(act[i]nodemcheckstate==)flag=;
 else{flag=;flag=;break;}
 if((flag)&&(flag))this_setCheck(dhtmlObjectnotsure);
 else if(flag)this_setCheck(dhtmlObjectfalse);
 else this_setCheck(dhtmlObjecttrue);
 
 this_correctCheckStates(dhtmlObjectparentObject);
}
 
 
 dhtmlXTreeObjectprototypeonCheckBoxClick=function(e){
 if(thistreeNodtscheck)
 if(thisparentObjectcheckstate==)thistreeNod_setSubChecked(falsethisparentObject);
 else thistreeNod_setSubChecked(truethisparentObject);
 else
 if(thisparentObjectcheckstate==)thistreeNod_setCheck(thisparentObjectfalse);
 else thistreeNod_setCheck(thisparentObjecttrue);
 thistreeNod_correctCheckStates(thisparentObjectparentObject);
 if(thistreeNodcheckFuncHandler)return(thistreeNodcheckFuncHandler(thisparentObjectidthisparentObjectcheckstate));
 else return true;
};
 
 dhtmlXTreeObjectprototype_createItem=function(acheckitemObjectmode){
 var table=documentcreateElement(table);
 tablecellSpacing=;tablecellPadding=;
 tableborder=;
 if(thishfMode)tablestyletableLayout=fixed;
 tablestylemargin=;tablestylepadding=;
 
 var tbody=documentcreateElement(tbody);
 var tr=documentcreateElement(tr);
 var td=documentcreateElement(td);
 tdclassName=standartTreeImage;
 var img=documentcreateElement(img);
 imgborder=;tdappendChild(img);imgstylepadding=;
 
 var td=documentcreateElement(td);
 var inp=documentcreateElement(img);inpchecked=;inpsrc=thisimPath+thischeckArray[];inpstylewidth=px;inpstyleheight=px;
 if(!acheck)inpstyledisplay=none;
 tdappendChild(inp);
 tdwidth=px;
 inponclick=thisonCheckBoxClick;
 inptreeNod=this;
 inpparentObject=itemObject;
 var td=documentcreateElement(td);
 tdclassName=standartTreeImage;
 var img=documentcreateElement(img);imgonmousedown=this_preventNsDrag;
 imgborder=;
 if(!mode)imgsrc=thisimPath+thisimageArray[];
 tdappendChild(img);imgstylepadding=;imgstylemargin=;
 if(thistimgen)
{imgstylewidth=px;imgstyleheight=px;}
 else
{imgstylewidth=px;imgstyleheight=px;}

  </script>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19197.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.