`
咖啡刀
  • 浏览: 8351 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

新手请教个关于DhtmlxTree的问题!

阅读更多
以下是所有的代码(所有原代码都在包里):
<html>
<head>
<title>Tree</title>
<style>
body {font-size:12px}
.{font-family:arial;font-size:12px}
h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
.hdr{
background-color:lightgrey;
margin-bottom:10px;
padding-left:10px;
}
</style>
<link rel="stylesheet" type="text/css" href="Css/dhtmlXTree.css"/>
<script  src="JavaScript/dhtmlXCommon.js"></script>
<script  src="JavaScript/dhtmlXTree.js"></script>
</head>
<body>
<div class="hdr">DHTML JavaScript Tree samples</div>
<table>
<tr>
<td valign="top">
<div id="MainMenuTreeBox_Tree" style="width:250; height:418;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div>
</td>
<td  style="padding-left:25" valign="top">Three state checkboxes<br><br>
<a href="javascript:void(0);" onclick="tree.setCheck(tree.getSelectedItemId(),true);">Check item</a><br><br>
<a href="javascript:void(0);" onclick="tree.setCheck(tree.getSelectedItemId(),false);">UnCheck item</a><br><br>
<a href="javascript:void(0);" onclick="alert(tree.getAllChecked());">Get list of checked</a><br><br>
<a href="javascript:void(0);" onclick="catchValue();">Write checked</a><br><br>
                <br>
</td>
</tr>
</table>
<hr>
<script>
tree=new dhtmlXTreeObject("mainMenuTreeBox_Tree","100%","100%",0);
tree.setImagePath("Images/");
tree.enableCheckBoxes(1);
tree.enableThreeStateCheckboxes(true);
//tree.enableDragAndDrop(true);
//可动态进行改变树级目录
tree.loadXML("XmlFile/mainMenuTree.xml");
</script>
<br><br>
<p><a href="javascript:self.close()">Close this page</a></p>
</body>
</html>
<script type="text/javascript" language="javascript">
<!--
function catchValue()
{
    var valueData=tree.getSelectedItemText();
    alert(valueData); 
    var checked=tree.getAllChecked();
   
    /*******************************问题处*******************************************
    在这里怎样才能把checked这个字符串中以逗号为分割的字符进行拆解,或者说是怎样可以
    直接得到各个根接点以及根接点下字节点的值,比如说用循环的方式来处理。在这里应该怎样写啦!
    我看他的开发文档中好象不支持去取单个接点的值啦!!我用的是他的标准版!!!
    *********************************************************************************/
    alert(checked);
}
//全部展开或者全部收缩
//-->
</script>

望熟悉使用过这个控件的Jser帮个忙啦!!
在下感激溜涕啦!!!
分享到:
评论
12 楼 咖啡刀 2007-08-01  
呵呵
我是说我自己用的这种方式比较笨啊!!
不是说这个API啦!!
11 楼 pijunliang 2007-08-01  
<p>加我MS:<a href='mailto:pijunliang@hotmail.com'>pijunliang@hotmail.com</a> 详细给你说,我已经解决了,</p>
<p>因为你没用好,所以你就会认为人家笨拙</p>
10 楼 咖啡刀 2007-07-19  
pijunliang 写道
这个问题还在困扰你吗?还是说你已经解决了这个问题呢?解决了就共享下解决方法,没解决就一起解决,我也在弄DHTMLXTREE
你好!!!
准确的说没找到解决的办法!!!
因为我用他里面的API没有得到这个想要的效果,所以我只好自己用循环的方式把所有的checkbox的checked属性都统统的判断一次,然后得到值!!

大体上实现的方式是这样子的,觉得很苯.
9 楼 pijunliang 2007-07-18  
这个问题还在困扰你吗?还是说你已经解决了这个问题呢?解决了就共享下解决方法,没解决就一起解决,我也在弄DHTMLXTREE
8 楼 咖啡刀 2007-06-28  
先行谢谢啦!!!
不过,不知道为什么在我用的这个里面你说的几个API都不能得到想要的结果啊

就是取出已经选中的那个checkbox的id或者是值
7 楼 zhenjia 2007-06-24  
我没听清楚你要干什么 但是API明明就有你要的方法
单个得到子节点的ID 或者根据checked节点ID 得到下所有子节点ID
或者根据checked节点ID 得到有多少子节点
getChildItemIdByIndex(itemId,index)
retun child node id by index

getSubItems(itemId)
Returns the list of all children items from the next level of tree, separated by commas.

hasChildren(itemId)
return number of childrens
6 楼 ddandyy 2007-05-15  
牛啊       
5 楼 咖啡刀 2007-05-15  
谢谢啦!!!
4 楼 咖啡刀 2007-05-15  
这个html文件就是我下载的这个版本中提供的api,能帮忙给我指导下吗??

谢谢啦
3 楼 咖啡刀 2007-05-15  
我下载的是他的那个标准版本,他提供的API就这些!!
我使用了与checked这个api相关的方法,但都没做到。
现在我把这些api提供如下,能帮我看看吗????

assignKeys(keys) [Professional]
configure keys used for keyboard navigation

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_kn.js
keys - configuration array, please check samples/pro_key_nav.html for more details
changeItemId(itemId,newItemId)
change item id

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - old node id
newItemId - new node id
clearCut()
clear cut

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
clearSelection(itemId) [Professional]
unselect item in tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
itemId - used in multi selection tree
closeAllItems(itemId)
collapse target node and all child nodes

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - node id
closeItem(itemId)
collapse node

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
defineItemForm(formId) [Professional]
assign custom form to tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_if.js
formId - id of form node
deleteChildItems(itemId)
delete all children of node

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
deleteItem(itemId,selectParent)
delete node

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
selectParent - If true parent of deleted item get selection, else no selected items leaving in tree.
disableCheckbox(itemId,mode) [Professional]
disable checkbox

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - Id of tree item
mode - 1 - on, 0 - off;
disableDropCheck(mode) [Professional]
disable parent-child check while drag and drop

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_dd.js
mode - 1 - on, 0 - off;
doCut()
mark selected item as cutted

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
doPaste(itemId)
insert previously cutted branch

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - id of new parent node
editItem(id) [Professional]
enable editing of item's names

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_ed.js
mode - true/false
enableActiveImages(mode)
enable active images (clickable and dragable)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableAutoSavingSelected(mode,cookieName) [Professional]
enable/disable autosaving selected node in cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
mode - true/false
enableAutoTooltips(mode) [Professional]
enable auto tooltips (node text as tooltip)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableCheckBoxes(mode, hidden)
hide checkboxes (all checkboxes in tree)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - enabled/disabled
hidden - if set to true, checkboxes not rendered but can be shown by showItemCheckbox
enableContextMenu(menu) [Professional]
enable context menu

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
menu - dhtmlXmenu object
enableDHTMLXTooltips(mode) [Professional]
enable DHTMLX tootltips

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - true/false
enableDistributedParsing(mode,count,delay) [Professional]
enable distributed parsing of long items list

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
mode - true/false
count - critical count to start distibuting (optional)
delay - delay between distributed calls, ms (optional)
enableDragAndDrop(mode,rmode)
enable/disable drag-and-drop

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - enabled/disabled [ can be true/false/temporary_disabled - last value mean that tree can be D-n-D can be switched to true later ]
rmode - enabled/disabled drag and drop on super root
enableDragAndDropScrolling(mode)
enable/disable auto scrolling while drag-and-drop

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - enabled/disabled
enableHighlighting(mode)
enable item highlighting (item text highlited on mouseover)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableIEImageFix(mode)
replace IMG tag with background images - solve problem with IE image caching , not works for IE6 SP1

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - true/false - enable/disable fix
enableImageDrag(mode)
create enable draging of item image with item text

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
mode - true/false
enableItemEditor(mode) [Professional]
enable editing of item's names

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_ed.js
mode - true/false
enableKeyboardNavigation(mode) [Professional]
enable keyboard navigation in tree

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_kn.js
mode - true/false
enableKeySearch(mode) [Professional]
enable search items by key pressing

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_kn.js
mode - true/false
enableLoadingItem(text) [Experimental]
enable/disable loading XMl item

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_lf.js
text - text of temporary item
enableMercyDrag(mode) [Professional]
enable drag without removing (copy instead of move)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableMultiLineItems(width) [Professional]
enable multi line items

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
width - text width, if equls zero then use single lines items;
enableMultiselection(mode,strict) [Professional]
enable multiselection

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
strict - 1 - on, 0 - off; in strict mode only items on the same level can be selected
enableRadioButtons(itemId,mode) [Professional]
replace checkboxes with radio buttons

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
mode - true/false
itemId - node for which replacement called (optional)
enableRTL(mode) [Professional]
return xml description of tree

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_rl.js
mode - true/false
enableSingleRadioMode(mode) [Professional]
replace checkboxes with radio buttons

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
mode - true/false
itemId - node for which replacement called (optional)
enableSmartCheckboxes(mode) [Professional]
enable smart checkboxes ,true by default (auto checking childs and parents for 3-state checkboxes)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableSmartXMLParsing(mode) [Professional]
enable/disable smart XML parsing mode (usefull for big, well structured XML)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableTextSigns(mode) [Professional]
replace images with text signs

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
mode - true/false
enableThreeStateCheckboxes(mode)
enable three state checkboxes

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableTreeImages(mode)
enable tree images

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableTreeLines(mode)
enable/disable tree lines (parent-child threads)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
mode - enable/disable tree lines
findItem(searchStr,direction,top) [Professional]
find tree item by text, select and focus it

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
searchStr - search text
direction - 0: top -> bottom; 1: bottom -> top
top - 1: start searching from top
findItemIdByLabel(searchStr,direction,top) [Professional]
find tree item by text

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
searchStr - search text
direction - 0: top -> bottom; 1: bottom -> top
top - 1: start searching from top
focusItem(itemId)
focus item in tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
itemId - item Id
getAllChecked()
return list of identificators of nodes with checked checkboxes, separated by comma

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
getAllCheckedBranches()
return list of identificators of nodes with checked and third state checkboxes, separated by comma

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
getAllChildless()
Returns the list of all items which doesn't have child nodes.

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
getAllItemsWithKids()
Returns the list of all items which has child nodes, separated by commas.

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
getAllPartiallyChecked()
return list of identificators of nodes with third state checkboxes, separated by comma

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
getAllSubItems(itemId)
Returns the list of all children items from all next levels of tree, separated by commas.

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
getAllUnchecked(itemId)
return list of identificators of nodes with unchecked checkboxes, separated by comma

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
getChildItemIdByIndex(itemId,index)
retun child node id by index

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
itemId - parent node id
index - index of child node
getDistributedParsingState() [Professional]
get current state of distributed parsing

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
Returns: true - still parsing; false - parsing finished
getIndexById(itemId)
retun node index in childs collection by Id

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
getItemColor(itemId)
get node color

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
getItemIdByIndex(itemId,index)
retun node id by index

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
itemId - parent node id
index - index of node, 0 based
getItemImage(itemId,imageInd,fullPath) [Professional]
get source of item's image

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - id of item
imageInd - index of image ( 0 - leaf, 1 - closed folder, 2 - opened folder)
value - value of top offset
getItemParsingState(itemId) [Professional]
get current parsing state of item

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
Returns: 1 - item already parsed; 0 - item not parsed yet; -1 - item in parsing process
getItemText(itemId)
return item text

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
getItemTooltip(itemId)
get item's tooltip

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
getLevel(itemId)
return node level (position in hierarchy)

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
getOpenState(itemId)
return open/close state

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - node id
getParentId(itemId)
return parent item id

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
getSelectedItemId()


Object: dhtmlXTreeObject

File required:dhtmlXTree.js
getSelectedItemId()
retun selected item id

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
getSelectedItemText()
retun selected node text

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
getSubItems(itemId)
Returns the list of all children items from the next level of tree, separated by commas.

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
getUserData(itemId,name)
return user data from target node

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - target node id
name - key for user data
getXMLState() [Professional]
return current state of XML loading

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
hasChildren(itemId)
return number of childrens

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
hideItemForm(itemID,state) [Professional]
hide item's form

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree_if.js
itemID - item id
insertNewChild(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs)
create new node as a child to specified with parentId

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
parentId - parent node id
itemId - new node id
itemText - new node label
itemActionHandler - function fired on node select event (optional)
image1 - image for node without childrens; (optional)
image2 - image for closed node; (optional)
image3 - image for opened node (optional)
optionStr - options string (optional)
childs - node children flag (for dynamical trees) (optional)
insertNewNext(itemId,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs)
create new node next to specified

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
newItemId - new node id
itemText - new node text
itemActionHandler - function fired on node select event (optional)
image1 - image for node without childrens; (optional)
image2 - image for closed node; (optional)
image3 - image for opened node (optional)
optionStr - options string (optional)
childs - node childs flag (for dynamical trees) (optional)
isItemChecked(itemId)
return state of nodes's checkbox

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - target node id
isLocked(itemId) [Professional]
return locked state of item

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_li.js
itemId - id of item
Returns: true/false - locked/unlocked
loadOpenStates(name) [Professional]
restore open nodes from cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional,cookie name
loadState(name) [Professional]
load tree from cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional,cookie name
loadXML(file,afterCall)
load tree from xml file

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
file - link to XML file
afterCall - function which will be called after xml loading
loadXMLString(xmlString,afterCall)
load tree from xml string

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
xmlString - XML string
afterCall - function which will be called after xml loading
lockItem(itemId,state) [Professional]
lock/unlock item

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_li.js
itemId - id of item
state - true/false - lock/unlock item
lockTree(isLock) [Professional]
lock tree

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_li.js
isLock - bool value. True - lock, False - unlock
makeAllDraggable(func)
make all HTML items with dragInDhtmlXTree attribute dragable in tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlxTree_dragIn.js
func - custom drag processor function, optional
makeDragable(obj,func)
make item dragable in tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlxTree_dragIn.js
obj - HTML object, or HTML object ID
func - custom drag processor function, optional
moveItem(itemId,mode,targetId,targetTree) [Professional]
move item (inside of tree)

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - item Id
mode - moving mode (left,up,down,item_child,item_sibling,item_sibling_next,up_strict,down_strict)
targetId - target Node in item_child and item_sibling mode
targetTree - used for moving between trees (optional)
openAllItems(itemId)
expand target node and all child nodes

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - node id
openAllItemsDynamic(itemId) [Professional]
expand target node and all child nodes (same as openAllItems, but works in dynamic trees)

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_xw.js
itemId - node id, optional
openItem(itemId)
expand node

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
openItemsDynamic(list,flag) [Professional]
expand list of nodes in dynamic tree (wait of loading of node before expanding next)

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_xw.js
list - list of nodes which will be expanded
flag - true/false - select last node in the list
openOnItemAdding(mode) [Professional]
configure if parent node will be expanded immideatly after child item adding

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
mode - true/false
preventIECashing(mode)
prevent caching in IE by adding random seed to URL string

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - enable/disable random seed ( disabled by default )
refreem(itemId)
refresh tree branch from xml (XML with description of child nodes rerequested from server)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node, if not defined tree super root used.
refreems(itemIdList,source) [Professional]
refresh specified tree nodes (get XML from server and updat only nodes included in itemIdList)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemIdList - list of node identificators
source - server side script
registerXMLEntity(rChar,rEntity) [Professional]
register XML entity for replacement while initialization

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
rChar - source char
rEntity - target entity
restoreSelectedItem(name) [Professional]
restore selected item from cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional, cookie name
saveOpenStates(name,cookie_param) [Professional]
save open nodes to cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional,cookie name
cookie_param - additional parametrs added to cookie
saveSelectedItem(name,cookie_param) [Professional]
save selected item to cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional, cookie name
cookie_param - additional parametrs added to cookie
saveState(name,cookie_param) [Professional]
save tree to cookie

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
name - optional, cookie name
cookie_param - additional parametrs added to cookie
selectItem(itemId,mode,preserve)
select node ( and optionaly fire onselect event)

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
itemId - node id
mode - If true, script function for selected node will be called.
preserve - preserve earlie selected nodes
serializeTree() [Professional]
return xml description of tree

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
setCheck(itemId,state)
change state of node's checkbox

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - target node id
state - checkbox state (0/1/unsure)
setChildCalcHTML( htmlA,htmlB ) [Professional]
set child calculation prefix and postfix

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
htmlA - postfix ([ - by default)
htmlB - postfix (] - by default)
setChildCalcMode( mode ) [Professional]
set child calculation mode

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - mode name as string . Possible values: child - child, no recursive; leafs - child without subchilds, no recursive; ,childrec - child, recursive; leafsrec - child without subchilds, recursive; disabled (disabled by default)
setCustomSortFunction(func) [Professional]
set custom sort functions, which has two parametrs - id_of_item1,id_of_item2

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_sb.js
func - sorting function
setDragBehavior(mode,select) [Professional]
set Drag-And-Drop behavior (child - drop as chils, sibling - drop as sibling, complex - complex drop behaviour )

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - behavior name (child,sibling,complex)
select - select droped node after drag-n-drop, true by default
setDragHandler(func) [Depricated]
set function called when drag-and-drop event occured

Depricated! - use grid.attachEvent("onDrag",func); instead

EventName:onDrag
Event occured after item was dragged and droped on another item, but before item moving processed.
ID of source item
ID of target item
if node droped as sibling then contain id of item before whitch source node will be inserted
source Tree object
target Tree object
Event returns:true - confirm drag-and-drop; false - deny drag-and-drop;
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
aFunc - event handling function
setDropHandler(func) [Professional] [Depricated]
set function called after drag-and-drap event occured

Depricated! - use grid.attachEvent("onDrop",func); instead

EventName:onDrop
Event raised after drag-and-drop processed. Event also raised while programmatic moving nodes.
ID of source item (ID after inserting in tree, my be not equal to initial ID)
ID of target item
if node droped as sibling then contain id of item before whitch source node will be inserted
source Tree object
target Tree object
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setEditStartAction(click_IE, dblclick) [Professional]
define which events must start editing

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_ed.js
click_IE - click on already selected item - true/false [true by default]
dblclick - click on already selected item - true/false [true by default]
setEscapingMode(mode)
set escaping mode (used for escaping ID in server requests)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
mode - escaping mode ("utf8" for UTF escaping)
setFormAppearOn(onClick,onDblClick,onMouseOver) [Professional]
define events for form appearing

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_if.js
onClick - form appears on click event
onDblClick - form appears on double click event
onMouseOver - form appears on mouseover event
setFormDisappearOn(onClick,onDblClick,onMouseOver) [Professional]
define events for form disappearing

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_if.js
onClick - form disappears on click event
onDblClick - form disappears on double click event
onMouseOver - form disappears on mouseover event
setIconSize(newWidth,newHeight,itemId) [Professional]
set size of gfx icons

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
newWidth - new icon width
newHeight - new icon height
itemId - item Id, if skipped set default value for all new icons, optional
setImageArrays(arrayName,image1,image2,image3,image4,image5)
set images used for parent-child threads drawing

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
arrayName - name of array: plus, minus
image1 - line crossed image
image2 - image with top line
image3 - image with bottom line
image4 - image without line
image5 - single root image
setImagePath( newPath )
set path to image directory

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
newPath - path to image directory
setItemCloseable(itemId,flag)
prevent node from closing

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
itemId - id of node
flag - if 0 - node can't be closed, else node can be closed
setItemColor(itemId,defaultColor,selectedColor)
set node color

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
defaultColor - node color
selectedColor - selected node color
setItemContextMenu(itemId,cMenu) [Professional]
set context menu to individual nodes

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
cMenu - context menu object
setItemImage(itemId,image1,image2)
set item images

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
image1 - node without childrens image or closed node image (if image2 specified)
image2 - open node image (optional)
setItemImage2(itemId, image1,image2,image3)
set item images

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
image1 - node without childrens image
image2 - closed node image
image3 - open node image
setItemStyle(itemId,style_string)
set individual item style

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - node id
style_string - valid CSS string
setItemText(itemId,newLabel,newTooltip)
set new node text (HTML allowed)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of node
newLabel - node text
newTooltip - (optional)tooltip for the node
setItemTopOffset(itemId,value) [Professional]
set top offset for item

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree.js
itemId - id of item
value - value of top offset
setListDelimeter(separator) [Professional]
set list separator (comma by default)

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
separator - char or string using for separating items in lists
setLockedIcons(im0,im1,im2) [Professional]
set icon for locked items

Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree_li.js
im0 - icon for locked leaf
im1 - icon for closed branch
im2 - icon for opened branch
setOnCheckHandler(func) [Depricated]
set function called before checkbox checked/unchecked

Depricated! - use grid.attachEvent("onCheck",func); instead

EventName:onCheck
Event raised immideatly after item in tree was checked/unchecked.
ID of item which will be checked/unchecked
Current checkbox state. 1 - item checked, 0 - item unchecked.
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnClickHandler(func) [Depricated]
set function called when tree node clicked, also can be forced to call from API

Depricated! - use grid.attachEvent("onClick",func); instead

EventName:onClick
Event raised immideatly after text part of item in tree was clicked, but after default onClick functionality was processed.
ID of clicked item
ID of previously selected item
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnDblClickHandler(func) [Depricated]
set function called when tree node double clicked

Depricated! - use grid.attachEvent("onDblClick",func); instead

EventName:onDblClick
Event raised immideatly after item in tree was doubleclicked, before default onDblClick functionality was processed.
ID of item which was doubleclicked
Event returns:true - confirm opening/closing; false - deny opening/closing;
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnDragIn(func) [Professional] [Depricated]
set function called when tree item draged over another item

Depricated! - use grid.attachEvent("onDragIn",func); instead

EventName:onDragIn
Event raised when item draged other other dropable target
ID draged item
ID potencial drop landing
source object
target object
Event returns:true - allow drop; false - deny drop;
Object: dhtmlXTreeObject
Topic(s): Node/level control;
File required:dhtmlXTree.js
func - event handling function
setOnEditHandler(func) [Professional] [Depricated]
set onEdit handler ( multi handler event)

Depricated! - use grid.attachEvent("onEdit",func); instead

EventName:onEdit
Event occurs on 4 different stages of edit process: before editing started (cancelable), after editing started, before closing (cancelable), after closed
state - 0 before editing started , 1 after editing started, 2 before closing, 3 after closed
id - id of edited items
tree - tree object
value - for stage 0 and 2, value of editor
Event returns:for stages 0 and 2; true - confirm opening/closing, false - deny opening/closing; text - edit value
Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_ed.js
func - function which will be called on edit related events
setOnFormDismissal(func) [Professional]
allow to set user routine which will be called immideatly before form disappears

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_if.js
func - user defined function
setOnFormInitialisation(func) [Professional]
allow to set user routine which will be called immideatly before form appears

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_if.js
func - user defined function
setOnLoadingEnd(func) [Professional] [Depricated]
set function called after xml loading/parsing ended

Depricated! - use grid.attachEvent("onXLE",func); instead

EventName:onXLE
event fired simultaneously with ending XML parsing, new items already available in tree
tree object
last parsed parent id
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnLoadingStart(func) [Professional] [Depricated]
set function called before xml loading/parsing started

Depricated! - use grid.attachEvent("onXLS",func); instead

EventName:onXLS
event fired simultaneously with starting XML parsing
tree object
item id, for which xml loaded
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnMouseInHandler(func) [Depricated]
set function called when mouse is over tree node

Depricated! - use grid.attachEvent("onMouseIn",func); instead

EventName:onMouseIn
Event raised immideatly after mouse hovered over item
ID of item
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnMouseOutHandler(func) [Depricated]
set function called when mouse is out of tree node

Depricated! - use grid.attachEvent("onMouseOut",func); instead

EventName:onMouseOut
Event raised immideatly after mouse moved out of item
ID of clicked item
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnOpenEndHandler(func) [Depricated]
set function called after tree node opened/closed

Depricated! - use grid.attachEvent("onOpenEnd",func); instead

EventName:onOpenEnd
Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
ID of node which will be opened/closed
Current open state of tree item. 0 - item has not childs, -1 - item closed, 1 - item opened.
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnOpenStartHandler(func) [Depricated]
set function called before tree node opened/closed

Depricated! - use grid.attachEvent("onOpenStart",func); instead

EventName:onOpenStart
Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
ID of node which will be opened/closed
Current open state of tree item. 0 - item has not childs, -1 - item closed, 1 - item opened.
Event returns:true - confirm opening/closing; false - deny opening/closing;
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setOnRightClickHandler(func) [Depricated]
set function called when tree node selected

Depricated! - use grid.attachEvent("onRightClick",func); instead

EventName:onRightClick
Event occured after right mouse button was clicked.
(string) ID of clicked item
(object) event object
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
(function) func - event handling function
setOnSelectStateChange(func) [Depricated]
set function called when tree node selected or unselected, include any select change caused by any functionality

Depricated! - use grid.attachEvent("onSelect",func); instead

EventName:onSelect
Event raised immideatly after selection in tree was changed
selected item ID ( list of IDs in case of multiselection)
Object: dhtmlXTreeObject
Topic(s): Initialization; Handlers;
File required:dhtmlXTree.js
func - event handling function
setSerializationLevel(userData,fullXML,escapeEntities,userDataAsCData,DTD) [Professional]
configure XML serialization

Object: dhtmlXTreeObject
Topic(s): Add/delete;
File required:dhtmlXTree_xw.js
userData - enable/disable user data serialization
fullXML - enable/disable full XML serialization
escapeEntities - convert tag brackets to related html entitites
userDataAsCData - output user data in CDATA sections
DTD - if specified, then set as XML's DTD
setStdImages(image1,image2,image3)
set default images for nodes (must be called before XML loading)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
a0 - image for node without childrens;
a1 - image for closed node;
a2 - image for opened node
setSubChecked(itemId,state)
change state of node's checkbox and all childnodes checkboxes

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - target node id
state - checkbox state
setUserData(itemId,name,value)
set user data for target node

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - target node id
name - key for user data
value - user data
setXMLAutoLoading(filePath)
enables dynamic loading from XML

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree.js
filePath - name of script returning XML; in case of virtual loading - user defined function
setXMLAutoLoadingBehaviour(mode) [Professional]
define which script be called on dynamic loading

Object: dhtmlXTreeObject
Topic(s): Selection control;
File required:dhtmlXTree.js
mode - id for some_script?id=item_id ; name for some_scriptitem_id, xmlname for some_scriptitem_id.xml ; function for calling user defined handler
showItemCheckbox(itemId,state) [Professional]
show/hide checkbox for tree item (work only for individual items, not for all tree )

Object: dhtmlXTreeObject
Topic(s): Checkboxes/user data manipulation;
File required:dhtmlXTree.js
itemId - id of selected item, optional, set null to change states of all items
state - checkbox show state : 0/1
showItemForm(itemID,state) [Professional]
show item's form

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree_if.js
itemID - item id
showItemSign(itemId,state) [Professional]
show/hide (+/-) icon (work only for individual items, not for all tree )

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - id of selected item
state - show state : 0/1
smartRefreshBranch(itemId,source) [Professional]
refresh specified tree branch (get XML from server, add new nodes, remove not used nodes)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - top node in branch
source - server side script , optional
smartRefreem(itemId,source) [Professional]
refresh specified tree item (get XML from server, add new nodes, remove not used nodes)

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - top node in branch
source - server side script , optional
sortTree(nodeId,order,all_levels) [Professional]
reorder items in tree

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_sb.js
nodeId - id of top node
all_levels - sorting all levels or only current level
order - sorting order - ASC or DES
stopEdit() [Professional]
switch current edited item back to normal state

Object: dhtmlXTreeObject
Topic(s): Initialization;
File required:dhtmlXTree_ed.js
updateItem(itemId,name,im0,im1,im2,achecked) [Professional]
update item properties

Object: dhtmlXTreeObject
Topic(s): Appearence control;
File required:dhtmlXTree.js
itemId - list of node identificators
name - list of node identificators, optional
im0 - list of node identificators, optional
im1 - list of node identificators, optional
im2 - list of node identificators, optional
achecked - list of node identificators, optional

2 楼 抛出异常的爱 2007-05-15  
看犀牛书中有API
1 楼 咖啡刀 2007-05-15  
求教啦!!!
望高手给点指点啦!!!

相关推荐

    dhtmlxtree的一个实用demo

    总结来说,这个压缩包提供了一个关于dhtmlxtree的实际应用案例,特别是与权限管理相关的功能。通过学习这个demo,开发者可以了解到如何利用dhtmlxtree来创建交互式树形结构,并实现复杂的业务逻辑,如权限分配。同时...

    dhtmlXtree树 右dhtmlXtree键菜单

    在这个场景中,我们主要关注的是dhtmlXtree的右键菜单功能。 右键菜单是用户界面中一个常用的功能,它允许用户通过鼠标右键点击来触发特定的操作或功能。在dhtmlXtree中,右键菜单可以自定义,这样开发者可以根据...

    dhtmlxtree

    `dhtmlxtree` 是一个基于JavaScript的富客户端树形组件,它允许在Web应用程序中创建交互式的、可扩展的树状视图。这个组件由DHTMLX Suite提供,它是一个广泛使用的JavaScript UI库,包含一系列用于构建富客户端界面...

    dhtmlxTree

    **dhtmlxTree** 是一个强大的JavaScript库,用于在Web应用程序中创建交互式的树形视图。这个控件允许开发者构建可自定义的、功能丰富的树结构,适用于数据的分类和展示,例如导航菜单、文件系统模拟或者组织结构图。...

    专业版dhtmlxtree下载

    这个文件帮助开发者更方便地集成dhtmlxtree到现有的项目中,同时提供了一套统一的接口来处理各种常见的任务。 在实际应用中,dhtmlxtree可以与其他前端框架(如jQuery、AngularJS、React等)配合使用,提供更丰富的...

    dhtmlXTree1.6

    **dhtmlXTree1.6** 是一个基于JavaScript的组件,用于在Web应用程序中创建交互式的树状结构。这个组件允许开发者以动态和灵活的方式展示层次化的数据,常见于网站的导航菜单、文件系统或者组织架构等场景。...

    JS树:dhtmlxTree

    `readme.txt`可能包含了关于如何开始和版本信息等内容,而`index.html`通常是一个示例页面,展示了dhtmlxTree的不同功能和用法。 总之,dhtmlxTree是JavaScript开发者构建交互式树形结构的强大工具,它提供了丰富的...

    Dhtmlxtree的例子

    这个例子展示了如何简单地使用Dhtmlxtree,并且利用XML数据来构建树节点。 首先,我们需要理解Dhtmlxtree的核心概念。Dhtmlxtree是一个客户端的组件,它不依赖服务器端技术,如PHP或ASP.NET,而是通过JavaScript...

    dhtmlxTree v.3.0

    **DhtmlxTree v.3.0 知识点详解** DhtmlxTree是一款功能强大的JavaScript组件,主要用于在Web应用程序中构建交互式的树状结构。它允许用户以灵活的方式展示和操作层次化的数据,适用于菜单系统、文件目录浏览、组织...

    dhtmlxtree实例

    例如,在一个项目管理应用中,可以使用dhtmlxtree展示任务的层级关系,通过拖放调整任务顺序,通过复选框选择多个任务,通过右键菜单进行任务的增删改操作。 **六、API与配置选项** dhtmlxtree提供了丰富的API接口...

    dhtmlxtree例子

    这个方法需要返回符合dhtmlxtree加载XML格式的数据。 10. **XML数据格式**: 树形结构的数据通常以XML形式提供,XML的根节点是`&lt;tree&gt;`,每个节点是`&lt;item&gt;`标签,包含ID、文本和其他属性。例如: ```xml 节点...

    DhtmlxTree

    dhtmlx公司的系列组件包括以下几个,此处只上传的是其中的树控件: 包含dhtmlxTree(树型控件),dhtmlxTabbar(选项卡),dhtmlxGrid(数据表格),dhtmlxCombo(下拉选项),dhtmlxTreeGrid(树型表格),dhtmlxVault(文件上传控件...

    基于dhtmlxtree构建动态维护树

    在构建dhtmlxtree时,我们需要考虑以下几个核心知识点: 1. **数据库设计**: 在上述示例中,数据库表`GEC_ZYTJ`用于存储树的节点信息。表结构包含三个字段:`ID`(主键,通常为唯一标识符)、`PARENTID`(父节点...

    dhtmlxTree 2.1

    dhtmlxTree 2.1 版本是该组件的一个特定版本,具有优化的性能和一些增强的功能。 **1. 树形结构** dhtmlxTree允许开发者在网页上创建层次化的数据展示,如目录结构、组织架构或导航菜单。每个节点都可以包含子节点...

Global site tag (gtag.js) - Google Analytics