var RadTreeView_KeyboardHooked=false; var RadTreeView_Active=null; var RadTreeView_DragActive=null; var RadTreeView_MouseMoveHooked=false; var RadTreeView_MouseUpHooked=false; var RadTreeView_MouseY=0; var RadTreeViewGlobalFirstParam=null; var RadTreeViewGlobalSecondParam=null; var RadTreeViewGlobalThirdParam=null; var RadTreeViewGlobalFourthParam=null; var contextMenuToBeHidden=null; var safariKeyDownFlag=true; if(typeof (window.RadControlsNamespace)=="undefined"){ window.RadControlsNamespace=new Object(); } RadControlsNamespace.AppendStyleSheet=function(_1,_2,_3){ if(!_3){ return; } if(!_1){ document.write("<"+"link"+" rel='stylesheet' type='text/css' href='"+_3+"' />"); }else{ var _4=document.createElement("LINK"); _4.rel="stylesheet"; _4.type="text/css"; _4.href=_3; document.getElementById(_2+"StyleSheetHolder").appendChild(_4); } }; function RadTreeNode(){ this.Parent=null; this.TreeView=null; this.Nodes=new Array(); this.ID=null; this.ClientID=null; this.SignImage=null; this.SignImageExpanded=null; this.Image=0; this.ImageExpanded=0; this.Action=null; this.Index=0; this.Level=0; this.Text=null; this.Value=null; this.Category=null; this.NodeCss=null; this.NodeCssOver=null; this.NodeCssSelect=null; this.ContextMenuName=null; this.Enabled=true; this.Expanded=false; this.Checked=false; this.Selected=false; this.DragEnabled=1; this.DropEnabled=1; this.EditEnabled=1; this.ExpandOnServer=0; this.IsClientNode=0; this.Attributes=new Array(); this.IsFetchingData=false; this.CachedText=""; } RadTreeNode.prototype.ScrollIntoView=function(){ var _5=this.TextElement(); var _6=document.getElementById(this.TreeView.Container); _6.scrollTop=_5.offsetTop; }; RadTreeNode.prototype.Next=function(){ var _7=(this.Parent!=null)?this.Parent.Nodes:this.TreeView.Nodes; return (this.Index>=_7.length)?null:_7[this.Index+1]; }; RadTreeNode.prototype.Prev=function(){ var _8=(this.Parent!=null)?this.Parent.Nodes:this.TreeView.Nodes; return (this.Index<=0)?null:_8[this.Index-1]; }; RadTreeNode.prototype.NextVisible=function(){ if(this.Expanded&&this.Nodes.length>0){ return this.Nodes[0]; } if(this.Next()!=null){ return this.Next(); } var _9=this; while(_9.Parent!=null){ if(_9.Parent.Next()!=null){ return _9.Parent.Next(); } _9=_9.Parent; } return null; }; RadTreeNode.prototype.LastVisibleChild=function(_a){ var _b=_a.Nodes; var _c=_b.length; var _d=_b[_c-1]; var _e=_d; if(_d.Expanded&&_d.Nodes.length>0){ _e=this.LastVisibleChild(_d); } return _e; }; RadTreeNode.prototype.PrevVisible=function(){ var _f=this.Prev(); if(_f!=null){ if(_f.Expanded&&_f.Nodes.length>0){ return this.LastVisibleChild(_f); } return this.Prev(); } if(this.Parent!=null){ return this.Parent; } return null; }; RadTreeNode.prototype.Toggle=function(){ if(this.Enabled){ if(this.TreeView.FireEvent(this.TreeView.BeforeClientToggle,this)==false){ return; } (this.Expanded)?this.Collapse():this.Expand(); if(this.ExpandOnServer!=2){ this.TreeView.FireEvent(this.TreeView.AfterClientToggle,this); } } }; RadTreeNode.prototype.CollapseNonParentNodes=function(){ for(var i=0;i0){ rtvInsertHTML(_1c,_1a); var _1d=_1c.getElementsByTagName("IMG"); for(var i=0;i<_1d.length;i++){ RadTreeView.AlignImage(_1d[i]); } var _1f=_1c.getElementsByTagName("INPUT"); for(var i=0;i<_1f.length;i++){ RadTreeView.AlignImage(_1f[i]); } } _15.IsFetchingData=false; _15.TreeView.FireEvent(_15.TreeView.AfterClientToggle,_15); }; _14.send(null); }; RadTreeNode.prototype.Expand=function(){ if(this.ExpandOnServer){ if(!this.TreeView.FireEvent(this.TreeView.BeforeClientToggle,this)){ return; } if(this.ExpandOnServer==1){ this.TreeView.PostBack("NodeExpand",this.ClientID); return; } if(this.ExpandOnServer==2){ if(!this.IsFetchingData){ this.IsFetchingData=true; this.CachedText=this.TextElement().innerHTML; switch(this.TreeView.LoadingMessagePosition){ case 0: this.TextElement().innerHTML=""+this.TreeView.LoadingMessage+" "+this.TextElement().innerHTML; break; case 1: this.TextElement().innerHTML=this.TextElement().innerHTML+" "+""+this.TreeView.LoadingMessage+" "; break; case 2: rtvInsertHTML(this.TextElement().parentNode,"
"+this.TreeView.LoadingMessage+"
"); break; } var _20=this; window.setTimeout(function(){ _20.FetchDataOnDemand(); },20); return; } } } if(!this.Nodes.length){ return; } if(this.TreeView.SingleExpandPath){ this.CollapseNonParentNodes(); } var _21=document.getElementById("G"+this.ClientID); if(this.TreeView.ExpandDelay>0){ _21.style.overflow="hidden"; _21.style.height="1px"; _21.style.display="block"; _21.firstChild.style.position="relative"; window.setTimeout("rtvNodeExpand(1,'"+_21.id+"',"+this.TreeView.ExpandDelay+");",20); }else{ _21.style.display="block"; } this.ImageOn(); this.SignOn(); this.Expanded=true; if(!this.IsClientNode){ this.TreeView.UpdateExpandedState(); } }; RadTreeNode.prototype.GetParentPositions=function(){ var _22=this; var _23=""; while(_22!=null){ if(_22.Next()!=null){ _23=_23+"1"; }else{ _23=_23+"0"; } _22=_22.Parent; } return _23; }; RadTreeNode.prototype.Collapse=function(){ if(this.Nodes.length>0){ if(this.ExpandOnServer==1&&this.TreeView.NodeCollapseWired){ this.TreeView.PostBack("NodeCollapse",this.ClientID); return; } if(this.TreeView.ExpandDelay>0){ var _24=document.getElementById("G"+this.ClientID); if(_24.scrollHeight!="undefined"){ _24.style.overflow="hidden"; _24.style.display="block"; _24.firstChild.style.position="relative"; window.setTimeout("rtvNodeCollapse("+_24.scrollHeight+",'"+_24.id+"',"+this.TreeView.ExpandDelay+" );",20); }else{ this.CollapseNoEffect(); } }else{ this.CollapseNoEffect(); } this.ImageOff(); this.SignOff(); this.Expanded=false; this.TreeView.UpdateExpandedState(); } }; RadTreeNode.prototype.CollapseNoEffect=function(){ if(this.Nodes.length>0){ var _25=document.getElementById("G"+this.ClientID); _25.style.display="none"; this.ImageOff(); this.SignOff(); this.Expanded=false; this.TreeView.UpdateExpandedState(); } }; RadTreeNode.prototype.Highlight=function(e){ if(!this.Enabled){ return; } if(e){ if(this.TreeView.MultipleSelect&&(e.ctrlKey||e.shiftKey)){ if(this.Selected){ this.TextElement().className=this.NodeCss; this.Selected=false; if(this.TreeView.SelectedNode==this){ this.TreeView.SelectedNode=null; } this.TreeView.UpdateSelectedState(); return; } }else{ this.TreeView.UnSelectAllNodes(); } } this.TextElement().className=this.NodeCssSelect; this.TreeView.SelectNode(this); this.TreeView.FireEvent(this.TreeView.AfterClientHighlight,this); }; RadTreeNode.prototype.ExecuteAction=function(e){ if(this.IsClientNode){ return; } if(this.TextElement().tagName=="A"){ this.TextElement().click(); }else{ if(this.Action){ this.TreeView.PostBack("NodeClick",this.ClientID); } } if(e){ (document.all)?e.returnValue=false:e.preventDefault(); } }; RadTreeNode.prototype.Select=function(e){ if(this.TreeView.FireEvent(this.TreeView.BeforeClientClick,this,e)==false){ e.returnValue=false; if(e.preventDefault){ e.preventDefault(); } return; } if(this.Enabled){ this.Highlight(e); this.TreeView.LastHighlighted=this; this.ExecuteAction(); }else{ (document.all)?e.returnValue=false:e.preventDefault(); } this.TreeView.FireEvent(this.TreeView.AfterClientClick,this,e); }; RadTreeNode.prototype.UnSelect=function(){ if(this.TextElement().parentNode&&this.TextElement().parentNode.tagName=="A"){ this.TextElement().parentNode.className=this.NodeCss; } this.TextElement().className=this.NodeCss; this.Selected=false; }; RadTreeNode.prototype.Disable=function(){ this.TextElement().className=this.TreeView.NodeCssDisable; this.Enabled=false; this.Selected=false; if(this.CheckElement()!=null){ this.CheckElement().disabled=true; } }; RadTreeNode.prototype.Enable=function(){ this.TextElement().className=this.NodeCss; this.Enabled=true; if(this.CheckElement()!=null){ this.CheckElement().disabled=false; } }; RadTreeNode.prototype.Hover=function(e){ var _2a=(e.srcElement)?e.srcElement:e.target; if(this.TreeView.IsRootNodeTag(_2a)){ this.TreeView.SetBorderOnDrag(this,_2a,e); return; } if(this.Enabled){ if(this.TreeView.FireEvent(this.TreeView.BeforeClientHighlight,this)==false){ return; } this.TreeView.LastHighlighted=this; if(RadTreeView_DragActive!=null&&RadTreeView_DragActive.DragClone!=null&&(!this.Expanded)&&this.ExpandOnServer!=1){ var _2b=this; window.setTimeout(function(){ _2b.ExpandOnDrag(); },1000); } if(!this.Selected){ this.TextElement().className=this.NodeCssOver; if(this.Image){ this.ImageElement().style.cursor="hand"; } } this.TreeView.FireEvent(this.TreeView.AfterClientHighlight,this); } }; RadTreeNode.prototype.UnHover=function(e){ var _2d=(e.srcElement)?e.srcElement:e.target; if(this.TreeView.IsRootNodeTag(_2d)){ this.TreeView.ClearBorderOnDrag(_2d); return; } if(this.Enabled){ this.TreeView.LastHighlighted=null; if(!this.Selected){ this.TextElement().className=this.NodeCss; if(this.Image){ this.ImageElement().style.cursor="default"; } } this.TreeView.FireEvent(this.TreeView.AfterClientMouseOut,this); } }; RadTreeNode.prototype.ExpandOnDrag=function(){ if(RadTreeView_DragActive!=null&&RadTreeView_DragActive.DragClone!=null&&(!this.Expanded)){ if(RadTreeView_Active.LastHighlighted==this){ this.Expand(); } } }; RadTreeNode.prototype.CheckBoxClick=function(e){ if(this.Enabled){ if(this.TreeView.FireEvent(this.TreeView.BeforeClientCheck,this,e)==false){ (this.Checked)?this.Check():this.UnCheck(); return; } (this.Checked)?this.UnCheck():this.Check(); if(this.TreeView.AutoPostBackOnCheck){ this.TreeView.PostBack("NodeCheck",this.ClientID); this.TreeView.FireEvent(this.TreeView.AfterClientCheck,this); return; } this.TreeView.FireEvent(this.TreeView.AfterClientCheck,this); } }; RadTreeNode.prototype.Check=function(){ if(this.CheckElement()!=null){ this.CheckElement().checked=true; this.Checked=true; this.TreeView.UpdateCheckedState(); } }; RadTreeNode.prototype.UnCheck=function(){ if(this.CheckElement()!=null){ this.CheckElement().checked=false; this.Checked=false; this.TreeView.UpdateCheckedState(); } }; RadTreeNode.prototype.IsSet=function(a){ return (a!=null&&a!=""); }; RadTreeNode.prototype.ImageOn=function(){ var _30=document.getElementById(this.ClientID+"i"); if(this.ImageExpanded!=0){ _30.src=this.ImageExpanded; } }; RadTreeNode.prototype.ImageOff=function(){ var _31=document.getElementById(this.ClientID+"i"); if(this.Image!=0){ _31.src=this.Image; } }; RadTreeNode.prototype.SignOn=function(){ var _32=document.getElementById(this.ClientID+"c"); if(this.IsSet(this.SignImageExpanded)){ _32.src=this.SignImageExpanded; } }; RadTreeNode.prototype.SignOff=function(){ var _33=document.getElementById(this.ClientID+"c"); if(this.IsSet(this.SignImage)){ _33.src=this.SignImage; } }; RadTreeNode.prototype.TextElement=function(){ var _34=document.getElementById(this.ClientID); var _35=_34.getElementsByTagName("span")[0]; if(_35==null){ _35=_34.getElementsByTagName("a")[0]; } return _35; }; RadTreeNode.prototype.ImageElement=function(){ return document.getElementById(this.ClientID+"i"); }; RadTreeNode.prototype.CheckElement=function(){ return document.getElementById(this.ClientID).getElementsByTagName("input")[0]; }; RadTreeNode.prototype.IsParent=function(_36){ var _37=this.Parent; while(_37!=null){ if(_36==_37){ return true; } _37=_37.Parent; } return false; }; RadTreeNode.prototype.StartEdit=function(){ if(this.EditEnabled){ var _38=this.Text; this.TreeView.EditMode=true; var _39=this.TextElement().parentNode; this.TreeView.EditTextElement=this.TextElement().cloneNode(true); this.TextElement().parentNode.removeChild(this.TextElement()); var _3a=this; var _3b=document.createElement("input"); _3b.setAttribute("type","text"); _3b.setAttribute("size",this.Text.length+3); _3b.setAttribute("value",_38); _3b.className=this.TreeView.NodeCssEdit; var _3c=this; _3b.onblur=function(){ _3c.EndEdit(); }; _3b.onchange=function(){ _3c.EndEdit(); }; _3b.onkeypress=function(e){ _3c.AnalyzeEditKeypress(e); }; _3b.onsubmit=function(){ return false; }; _39.appendChild(_3b); this.TreeView.EditInputElement=_3b; _3b.focus(); _3b.onselectstart=function(e){ if(!e){ e=window.event; } if(e.stopPropagation){ e.stopPropagation(); }else{ e.cancelBubble=true; } }; var _3f=0; var _40=this.Text.length; if(_3b.createTextRange){ var _41=_3b.createTextRange(); _41.moveStart("character",_3f); _41.moveEnd("character",_40); _41.select(); }else{ _3b.setSelectionRange(_3f,_40); } } }; RadTreeNode.prototype.EndEdit=function(){ this.TreeView.EditInputElement.onblur=null; this.TreeView.EditInputElement.onchange=null; var _42=this.TreeView.EditInputElement.parentNode; this.TreeView.EditInputElement.parentNode.removeChild(this.TreeView.EditInputElement); _42.appendChild(this.TreeView.EditTextElement); if(this.TreeView.FireEvent(this.TreeView.AfterClientEdit,this,this.Text,this.TreeView.EditInputElement.value)!=false){ if(this.Text!=this.TreeView.EditInputElement.value){ var _43=this.ClientID+":"+this.TreeView.EscapeParameter(this.TreeView.EditInputElement.value); this.TreeView.PostBack("NodeEdit",_43); return; } } this.TreeView.EditMode=false; this.TreeView.EditInputElement=null; this.TreeView.EditTextElement=null; }; RadTreeNode.prototype.AnalyzeEditKeypress=function(e){ if(document.all){ e=event; } if(e.keyCode==13){ (document.all)?e.returnValue=false:e.preventDefault(); if(typeof (e.cancelBubble)!="undefined"){ e.cancelBubble=true; } this.EndEdit(); return false; } if(e.keyCode==27){ this.TreeView.EditInputElement.value=this.TreeView.EditTextElement.innerHTML; this.EndEdit(); } return true; }; RadTreeNode.prototype.LoadNodesOnDemand=function(s,_46,url){ if(_46==404){ var _48="CallBack URL not found: \n\r\n\r"+url+"\n\r\n\rAre you using URL Rewriter? Please, try setting the AjaxUrl property to match the correct URL you need"; alert(_48); this.TreeView.FireEvent(this.TreeView.AfterClientCallBackError,this.TreeView); }else{ try{ eval(s); var _49=window[this.ClientID+"ClientData"]; for(var i=0;i<_49.length;i++){ var _4b=_49[i][0]; var _4c=_4b.substring(0,_4b.lastIndexOf("_t")); var _4d=this.TreeView.FindNode(_4c); if(_4d){ this.TreeView.LoadNode(_49[i],null,_4d); }else{ _49[i][17]=0; this.TreeView.LoadNode(_49[i],null,this); } } } catch(e){ this.TreeView.FireEvent(this.TreeView.AfterClientCallBackError,this.TreeView); } } }; function RadTreeView(_4e){ if(window.tlrkTreeViews==null){ window.tlrkTreeViews=new Array(); } if(window.tlrkTreeViews[_4e]!=null){ var _4f=window.tlrkTreeViews[_4e]; _4f.Dispose(); } tlrkTreeViews[_4e]=this; this.Nodes=new Array(); this.AllNodes=new Array(); this.ClientID=null; this.SelectedNode=null; this.DragMode=false; this.DragSource=null; this.DragClone=null; this.LastHighlighted=null; this.MouseInside=false; this.HtmlElementID=""; this.EditMode=false; this.EditTextElement=null; this.EditInputElement=null; this.BeforeClientClick=null; this.BeforeClientHighlight=null; this.AfterClientHighlight=null; this.AfterClientMouseOut=null; this.BeforeClientDrop=null; this.AfterClientDrop=null; this.BeforeClientToggle=null; this.AfterClientToggle=null; this.BeforeClientContextClick=null; this.BeforeClientContextMenu=null; this.AfterClientContextClick=null; this.BeforeClientCheck=null; this.AfterClientCheck=null; this.AfterClientMove=null; this.AfterClientFocus=null; this.BeforeClientDrag=null; this.AfterClientEdit=null; this.AfterClientClick=null; this.BeforeClientDoubleClick=null; this.AfterClientCallBackError=null; this.DragAndDropBetweenNodes=false; this.AutoPostBackOnCheck=false; this.CausesValidation=true; this.ContextMenuVisible=false; this.ContextMenuName=null; this.ContextMenuNode=null; this.SingleExpandPath=false; this.ExpandDelay=2; this.TabIndex=0; this.AllowNodeEditing=false; this.LoadOnDemandUrl=null; this.LoadingMessage="(loading ...)"; this.LoadingMessagePosition=0; this.LoadingMessageCssClass="LoadingMessage"; this.NodeCollapseWired=false; this.RightToLeft=false; this.LastBorderElementSet=null; this.LastDragPosition="on"; this.LastDragNode=null; this.IsBuilt=false; } RadTreeView.AlignImage=function(_50){ _50.align="absmiddle"; _50.style.display="inline"; if(!document.all||window.opera){ if(_50.nextSibling&&_50.nextSibling.tagName=="SPAN"){ _50.nextSibling.style.verticalAlign="middle"; } if(_50.nextSibling&&_50.nextSibling.tagName=="INPUT"){ _50.nextSibling.style.verticalAlign="middle"; } } }; RadTreeView.prototype.OnInit=function(){ var _51=new Array(); this.PreloadImages(_51); GlobalTreeViewImageList=_51; var _52=document.getElementById(this.Container).getElementsByTagName("IMG"); for(var i=0;i<_52.length;i++){ var _54=_52[i].className; if(_51[_54]&&_54!=null&&_54!=""){ _52[i].src=_51[_54]; RadTreeView.AlignImage(_52[i]); } } this.LoadTree(_51); var _55=document.getElementById(this.Container).getElementsByTagName("INPUT"); for(var i=0;i<_55.length;i++){ RadTreeView.AlignImage(_55[i]); } var _56=this; this.OnKeyDownMozilla=function(e){ _56.KeyDownMozilla(e); }; if(document.addEventListener&&(!RadTreeView_KeyboardHooked)){ RadTreeView_KeyboardHooked=true; this.AttachEvent(document,"keydown",this.OnKeyDownMozilla); } if((!RadTreeView_MouseMoveHooked)&&(this.DragAndDrop)){ RadTreeView_MouseMoveHooked=true; this.AttachEvent(document,"mousemove",rtvMouseMove); } if(!RadTreeView_MouseUpHooked){ RadTreeView_MouseUpHooked=true; this.AttachEvent(document,"mouseup",rtvMouseUp); } this.AttachAllEvents(); this.IsBuilt=true; }; RadTreeView.prototype.AttachAllEvents=function(){ var _58=this; var _59=document.getElementById(this.Container); this.OnFocus=function(e){ rtvDispatcher(_58.ClientID,"focus",e); }; this.OnMouseOver=function(e){ rtvDispatcher(_58.ClientID,"mover",e); }; this.OnMouseOut=function(e){ rtvDispatcher(_58.ClientID,"mout",e); }; this.OnContextMenu=function(e){ rtvDispatcher(_58.ClientID,"context",e); }; this.OnScroll=function(e){ _58.Scroll(); }; this.OnClick=function(e){ rtvDispatcher(_58.ClientID,"mclick",e); }; this.OnDblClick=function(e){ rtvDispatcher(_58.ClientID,"mdclick",e); }; this.OnKeyDown=function(e){ rtvDispatcher(_58.ClientID,"keydown",e); }; this.OnSelectStart=function(e){ return false; }; this.OnDragStart=function(e){ return false; }; this.OnMouseDown=function(e){ rtvDispatcher(_58.ClientID,"mdown",e); }; this.OnUnload=function(e){ _58.Dispose(); }; this.AttachEvent(_59,"focus",this.OnFocus); this.AttachEvent(_59,"mouseover",this.OnMouseOver); this.AttachEvent(_59,"mouseout",this.OnMouseOut); this.AttachEvent(_59,"contextmenu",this.OnContextMenu); this.AttachEvent(_59,"scroll",this.OnScroll); this.AttachEvent(_59,"click",this.OnClick); this.AttachEvent(_59,"dblclick",this.OnDblClick); this.AttachEvent(_59,"keydown",this.OnKeyDown); this.AttachEvent(_59,"selectstart",this.OnSelectStart); this.AttachEvent(_59,"dragstart",this.OnDragStart); if(this.DragAndDrop){ this.AttachEvent(_59,"mousedown",this.OnMouseDown); } this.AttachEvent(window,"unload",this.OnUnload); this.RootElement=_59; }; RadTreeView.prototype.Dispose=function(){ if(this.disposed){ return; } this.disposed=true; this.DetachEvent(this.RootElement,"focus",this.OnFocus); this.DetachEvent(this.RootElement,"mouseover",this.OnMouseOver); this.DetachEvent(this.RootElement,"mouseout",this.OnMouseOut); this.DetachEvent(this.RootElement,"contextmenu",this.OnContextMenu); this.DetachEvent(this.RootElement,"scroll",this.OnScroll); this.DetachEvent(this.RootElement,"click",this.OnClick); this.DetachEvent(this.RootElement,"dblclick",this.OnDblClick); this.DetachEvent(this.RootElement,"keydown",this.OnKeyDown); this.DetachEvent(this.RootElement,"selectstart",this.OnSelectStart); this.DetachEvent(this.RootElement,"dragstart",this.OnDragStart); if(this.DragAndDrop){ this.DetachEvent(this.RootElement,"mousedown",this.OnMouseDown); } this.DetachEvent(window,"unload",this.OnUnload); this.RootElement=null; }; RadTreeView.prototype.PreloadImages=function(_66){ var _67=window[this.ClientID+"ImageData"]; for(var i=0;i<_67.length;i++){ _66[i]=_67[i]; } }; RadTreeView.prototype.FindNode=function(_69){ for(var i=0;i0){ _7b.Parent=this.AllNodes[_7c-1]; } if(_7a!=null){ _7b.Parent=_7a; } _7b.NodeCss=this.NodeCss; _7b.NodeCssOver=this.NodeCssOver; _7b.NodeCssSelect=this.NodeCssSelect; _7b.Text=cd[1]; _7b.Value=cd[2]; _7b.Category=cd[3]; if(_79!=null){ _7b.SignImage=_79[cd[4]]; _7b.SignImageExpanded=_79[cd[5]]; }else{ _7b.SignImage=GlobalTreeViewImageList[cd[4]]; _7b.SignImageExpanded=GlobalTreeViewImageList[cd[5]]; } if(cd[6]>0){ _7b.Image=_79[cd[6]]; } if(cd[7]>0){ _7b.ImageExpanded=_79[cd[7]]; } _7b.Selected=cd[8]; if(_7b.Selected){ this.SelectedNode=_7b; } _7b.Checked=cd[9]; _7b.Enabled=cd[10]; _7b.Expanded=cd[11]; _7b.Action=cd[12]; if(this.IsSet(cd[13])){ _7b.NodeCss=cd[13]; } if(this.IsSet(cd[14])){ _7b.ContextMenuName=cd[14]; } this.AllNodes[this.AllNodes.length]=_7b; if(_7b.Parent!=null){ _7b.Parent.Nodes[_7b.Parent.Nodes.length]=_7b; }else{ this.Nodes[this.Nodes.length]=_7b; } _7b.Index=cd[16]; _7b.DragEnabled=cd[18]; _7b.DropEnabled=cd[19]; _7b.ExpandOnServer=cd[20]; if(this.IsSet(cd[21])){ _7b.NodeCssOver=cd[21]; } if(this.IsSet(cd[22])){ _7b.NodeCssSelect=cd[22]; } _7b.Level=cd[23]; _7b.ID=cd[24]; _7b.IsClientNode=cd[25]; _7b.EditEnabled=cd[26]; _7b.Attributes=cd[27]; }; RadTreeView.prototype.Toggle=function(_7d){ this.FindNode(_7d).Toggle(); }; RadTreeView.prototype.Select=function(_7e,e){ this.FindNode(_7e).Select(e); }; RadTreeView.prototype.Hover=function(_80,e){ var _80=this.FindNode(_80); if(_80){ _80.Hover(e); } }; RadTreeView.prototype.UnHover=function(_82,e){ var _82=this.FindNode(_82); if(_82){ _82.UnHover(e); } }; RadTreeView.prototype.CheckBoxClick=function(_84,e){ this.FindNode(_84).CheckBoxClick(e); }; RadTreeView.prototype.Highlight=function(_86,e){ this.FindNode(_86).Highlight(e); }; RadTreeView.prototype.SelectNode=function(_88){ this.SelectedNode=_88; _88.Selected=true; this.UpdateSelectedState(); }; RadTreeView.prototype.GetSelectedNodes=function(){ var _89=new Array(); for(var i=0;i(_96.clientHeight+_96.scrollTop)){ _96.scrollTop+=((_97+_98)-(_96.clientHeight+_96.scrollTop)); } }; RadTreeView.prototype.KeyDown=function(e){ if(this.EditMode){ return; } var _9a=this.SelectedNode; if(_9a!=null){ if(e.keyCode==107||e.keyCode==109||e.keyCode==37||e.keyCode==39){ _9a.Toggle(); } if(e.keyCode==40&&_9a.NextVisible()!=null){ (document.all)?e.returnValue=false:e.preventDefault(); _9a.NextVisible().Highlight(e); _9a.NextVisible().KeepInView(); } if(e.keyCode==38&&_9a.PrevVisible()!=null){ (document.all)?e.returnValue=false:e.preventDefault(); _9a.PrevVisible().Highlight(e); _9a.PrevVisible().KeepInView(); } if(e.keyCode==13){ if(this.FireEvent(this.BeforeClientClick,this.SelectedNode,e)==false){ return; } _9a.ExecuteAction(e); this.FireEvent(this.AfterClientClick,this.SelectedNode,e); } if(e.keyCode==32){ _9a.CheckBoxClick(); (document.all)?e.returnValue=false:e.preventDefault(); } if(e.keyCode==113&&this.AllowNodeEditing){ _9a.StartEdit(); } }else{ if(e.keyCode==38||e.keyCode==40||e.keyCode==13||e.keyCode==32){ this.Nodes[0].Highlight(); this.Nodes[0].KeepInView(); (document.all)?e.returnValue=false:e.preventDefault(); } } }; RadTreeView.prototype.UpdateState=function(){ this.UpdateExpandedState(); this.UpdateCheckedState(); this.UpdateSelectedState(); }; RadTreeView.prototype.UpdateExpandedState=function(){ var _9b=""; for(var i=0;i1)){ for(var i=0;i-1||_e2.indexOf("AsyncRequest")>-1||_e2.indexOf("AsyncRequest")>-1||_e2.indexOf("AjaxNS")>-1){ eval(_e2); } }else{ if(this.CausesValidation){ if(!(typeof (Page_ClientValidate)!="function"||Page_ClientValidate())){ return; } } var _e3=this.PostBackFunction.replace(/@@arguments@@/g,_e1); eval(_e3); } }; RadTreeView.prototype.EscapeParameter=function(_e4){ var _e5=_e4.replace(/'/g,"&squote"); _e5=_e5.replace(/#/g,"&ssharp"); _e5=_e5.replace(/:/g,"&scolon"); _e5=_e5.replace(/\\/g,"\\\\"); return _e5; }; RadTreeView.prototype.IsRootNodeTag=function(_e6){ if(_e6&&_e6.tagName=="DIV"&&_e6.id.indexOf(this.ID)>-1){ return true; } return false; }; RadTreeView.prototype.SetBorderOnDrag=function(_e7,_e8,e){ if(this.DragAndDropBetweenNodes&&this.IsDragActive()){ this.LastDragNode=_e7; var _ea=this.CalculateYPos(e); var _eb=this.GetY(_e8); if(_ea<_eb+_e7.TextElement().offsetHeight){ _e8.style.borderTop="1px dotted black"; this.LastDragPosition="above"; }else{ _e8.style.borderBottom="1px dotted black"; this.LastDragPosition="below"; } this.LastBorderElementSet=_e8; } }; RadTreeView.prototype.ClearBorderOnDrag=function(_ec){ if(_ec&&this.DragAndDropBetweenNodes&&this.IsDragActive()){ _ec.style.borderTop="0px none black"; _ec.style.borderBottom="0px none black"; this.LastDragPosition="over"; } }; RadTreeView.prototype.AttachEvent=function(_ed,_ee,_ef){ if(_ed.attachEvent){ _ed.attachEvent("on"+_ee,_ef); }else{ if(_ed.addEventListener){ _ed.addEventListener(_ee,_ef,false); } } }; RadTreeView.prototype.DetachEvent=function(_f0,_f1,_f2){ if(_f0.detachEvent){ _f0.detachEvent("on"+_f1,_f2); }else{ if(_f0.removeEventListener){ _f0.removeEventListener(_f1,_f2,false); } } }; RadTreeView.prototype.IsDragActive=function(){ for(var key in tlrkTreeViews){ if((typeof (tlrkTreeViews[key])!="function")&&tlrkTreeViews[key].DragClone!=null){ return true; } } return false; }; RadTreeView.prototype.GetScrollBarWidth=function(){ try{ if(typeof (this.scrollbarWidth)=="undefined"){ var _f4,_f5=0; var _f6=document.createElement("div"); _f6.style.position="absolute"; _f6.style.top="-1000px"; _f6.style.left="-1000px"; _f6.style.width="100px"; _f6.style.overflow="auto"; var _f7=document.createElement("div"); _f7.style.width="1000px"; _f6.appendChild(_f7); document.body.appendChild(_f6); _f4=_f6.offsetWidth; _f5=_f6.clientWidth; document.body.removeChild(document.body.lastChild); this.scrollbarWidth=_f4-_f5; if(this.scrollbarWidth<=0||_f5==0){ this.scrollbarWidth=16; } } return this.scrollbarWidth; } catch(error){ return false; } }; function rtvIsAnyContextMenuVisible(){ for(var key in tlrkTreeViews){ if((typeof (tlrkTreeViews[key])!="function")&&tlrkTreeViews[key].ContextMenuVisible){ return true; } } return false; } function rtvAdjustScroll(){ if(RadTreeView_DragActive==null||RadTreeView_DragActive.DragClone==null||RadTreeView_Active==null){ return; } var _f9=RadTreeView_Active; var _fa=document.getElementById(RadTreeView_Active.Container); if(_fa){ var _fb,_fc; _fb=_f9.GetY(_fa); _fc=_fb+_fa.offsetHeight; if((RadTreeView_MouseY-_fb)<50&&_fa.scrollTop>0){ _fa.scrollTop=_fa.scrollTop-10; _f9.Scroll(); RadTreeView_ScrollTimeout=window.setTimeout(function(){ rtvAdjustScroll(); },100); }else{ if((_fc-RadTreeView_MouseY)<50&&_fa.scrollTop<(_fa.scrollHeight-_fa.offsetHeight+16)){ _fa.scrollTop=_fa.scrollTop+10; _f9.Scroll(); RadTreeView_ScrollTimeout=window.setTimeout(function(){ rtvAdjustScroll(); },100); } } } } function rtvMouseUp(e){ if(RadTreeView_Active==null){ return; } if(e&&!e.ctrlKey){ for(var key in tlrkTreeViews){ if((typeof (tlrkTreeViews[key])!="function")&&tlrkTreeViews[key].ContextMenuVisible){ contextMenuToBeHidden=tlrkTreeViews[key]; window.setTimeout(function(){ if(contextMenuToBeHidden){ contextMenuToBeHidden.HideContextMenu(); } },10); return; } } } if(RadTreeView_DragActive==null||RadTreeView_DragActive.DragClone==null){ return; } (document.all)?e.returnValue=false:e.preventDefault(); var _ff=RadTreeView_DragActive.DragSource; var _100=RadTreeView_Active.LastHighlighted; var _101=RadTreeView_Active; var _102="over"; var _103; if(_101.LastBorderElementSet){ _102=_101.LastDragPosition; _103=_101.LastDragNode; _101.ClearBorderOnDrag(_101.LastBorderElementSet); } if(_103){ _100=_103; } document.body.removeChild(RadTreeView_DragActive.DragClone); RadTreeView_DragActive.DragClone=null; if(_100!=null&&_100.DropEnabled==false){ return; } if(_ff==_100){ return; } if(RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.BeforeClientDrop,_ff,_100,e,_102)==false){ return; } if(_ff.IsClientNode||((_100!=null)&&_100.IsClientNode)){ return; } var _104=RadTreeView_DragActive.ClientID+"#"+_ff.ClientID+"#"; var _105=""; if(_100==null){ _105="null"+"#"+RadTreeView_DragActive.HtmlElementID; }else{ _105=_101.ClientID+"#"+_100.ClientID+"#"+_102; } if(_100==null&&RadTreeView_DragActive.HtmlElementID==""){ return; } var _106=_104+_105; RadTreeView_DragActive.PostBack("NodeDrop",_106); RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.AfterClientDrop,_ff,_100,e); RadTreeView_DragActive=null; } function rtvMouseMove(e){ if(rtvIsAnyContextMenuVisible()){ return; } if(RadTreeView_DragActive!=null&&RadTreeView_DragActive.DragClone!=null){ var newX,newY; RadTreeView_DragActive.DetermineDirection(); if(!RadTreeView_DragActive.RightToLeft){ newX=RadTreeView_DragActive.CalculateXPos(e)+8; newY=RadTreeView_DragActive.CalculateYPos(e)+4; }else{ newX=RadTreeView_DragActive.CalculateXPos(e)-RadTreeView_DragActive.DragClone.clientWidth-8; if((document.body.dir.toLowerCase()=="rtl"||document.dir.toLowerCase()=="rtl")&&document.all&&!window.opera){ newX-=RadTreeView_DragActive.GetScrollBarWidth(); } newY=RadTreeView_DragActive.CalculateYPos(e)+4; } RadTreeView_MouseY=newY; rtvAdjustScroll(); RadTreeView_DragActive.DragClone.style.zIndex=999; RadTreeView_DragActive.DragClone.style.top=newY+"px"; RadTreeView_DragActive.DragClone.style.left=newX+"px"; RadTreeView_DragActive.DragClone.style.display="block"; RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.AfterClientMove,e); } } function rtvNodeExpand(a,id,_10c){ var _10d=document.getElementById(id); var _10e=_10d.scrollHeight; var step=(_10e-a)/_10c; var _110=a+step; if(_110>_10e-1){ _10d.style.height=""; _10d.firstChild.style.position=""; }else{ _10d.style.height=_110+"px"; window.setTimeout("rtvNodeExpand("+_110+","+"'"+id+"',"+_10c+");",5); } } function rtvNodeCollapse(a,id,_113){ var _114=document.getElementById(id); var _115=_114.scrollHeight; var step=(_115-Math.abs(_115-a))/_113; var _117=a-step; if(_117<=3){ _114.style.height=""; _114.style.display="none"; _114.firstChild.style.position=""; }else{ _114.style.height=_117+"px"; window.setTimeout("rtvNodeCollapse("+_117+","+"'"+id+"',"+_113+" );",5); } } function rtvGetNodeID(e){ if(RadTreeView_Active==null){ return; } var _119=(e.srcElement)?e.srcElement:e.target; if(_119.nodeType==3){ _119=_119.parentNode; } if(_119.tagName=="IMG"&&_119.nextSibling){ var _11a=_119.className; if(_11a){ _11a=parseInt(_11a); if(_11a>12){ _119=_119.nextSibling; } } } if(_119.id==RadTreeView_Active.ID){ return null; } if(_119.id.indexOf(RadTreeView_Active.ID)>-1&&_119.tagName=="DIV"){ return _119.id; } while(_119!=null){ if((_119.tagName=="SPAN"||_119.tagName=="A")&&rtvInsideNode(_119)){ return _119.parentNode.id; } _119=_119.parentNode; } return null; } function rtvInsideNode(_11b){ if(_11b.parentNode&&_11b.parentNode.tagName=="DIV"&&_11b.parentNode.id.indexOf(RadTreeView_Active.ID)>-1){ return _11b.parentNode.id; } } function rtvDispatcher(t,w,e,p1,p2,p3){ if(!e){ e=window.event; } if(tlrkTreeViews){ var _122=rtvGetNodeID(e); var _123=tlrkTreeViews[t]; if(!_123.IsBuilt){ return; } if(rtvIsAnyContextMenuVisible()&&w!="mclick"&&w!="cclick"){ return; } if(_123.EditMode){ return; } RadTreeView_Active=_123; var _124=window.netscape&&!window.opera; var _125=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1); switch(w){ case "mover": if(_122!=null){ _123.MouseOverDispatcher(e,_122); } break; case "mout": if(_122!=null){ _123.MouseOutDispatcher(e,_122); } break; case "mclick": _123.MouseClickDispatcher(e); break; case "mdclick": if(_122!=null){ _123.DoubleClickDispatcher(e,_122); } break; case "mdown": _123.MouseDown(e); break; case "mup": _123.MouseUp(e); break; case "context": if(_122!=null){ _123.ContextMenu(e,_122); return false; } break; case "cclick": _123.ContextMenuClick(e,p1,p2,p3); break; case "focus": _123.Focus(e); case "keydown": if(!_124&&!_125){ _123.KeyDown(e); } } } } function rtvAppendStyleSheet(_126,_127){ var _128=(navigator.appName=="Microsoft Internet Explorer")&&((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)||(navigator.appVersion.toLowerCase().indexOf("mac")!=-1)); var _129=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1); if(_128||_129){ document.write("<"+"link"+" rel='stylesheet' type='text/css' href='"+_127+"'>"); }else{ var _12a=document.createElement("LINK"); _12a.rel="stylesheet"; _12a.type="text/css"; _12a.href=_127; document.getElementById(_126+"StyleSheetHolder").appendChild(_12a); } } function rtvInsertHTML(_12b,html){ if(_12b.tagName=="A"){ _12b=_12b.parentNode; } if(document.all){ _12b.insertAdjacentHTML("beforeEnd",html); }else{ var r=_12b.ownerDocument.createRange(); r.setStartBefore(_12b); var _12e=r.createContextualFragment(html); _12b.appendChild(_12e); } }