文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>dtree API

dtree API

时间:2007-08-04  来源:sdwsyjp

Functions(方法)

add()

Adds a node to the tree.
Can only be called before the tree is drawn.

id, pid and name are required.

Parameters(参数)

Name Type Description
id Number Unique identity number.
pid Number Number refering to the parent node. The value for the root node has to be -1.(注意类型为Number值???)
name String Text label for the node.
url String Url for the node.
title String Title for the node.
target String Target for the node.(见附录)
icon String Image file to use as the icon. Uses default if not specified.
iconOpen String Image file to use as the open icon. Uses default if not specified.
open Boolean Is the node open.

Example

mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');


openAll()(方法)

Opens all the nodes.
Can be called before and after the tree is drawn.

Example

mytree.openAll();


closeAll()(方法)

Closes all the nodes.
Can be called before and after the tree is drawn.

Example

mytree.closeAll();


openTo()

Opens the tree to a certain node and can also select the node.
Can only be called after the tree is drawn.(树状菜单展开)

Parameters

Name Type Description
id Number Identity number for the node.
select Boolean Should the node be selected.

Example

mytree.openTo(4, true);

Configuration

Variable Type Default Description
target String true Target for all the nodes.
folderLinks Boolean true Should folders be links.
useSelection Boolean true Nodes can be selected(highlighted).
useCookies Boolean true The tree uses cookies to rember it's state.
useLines Boolean true Tree is drawn with lines.
useIcons Boolean true Tree is drawn with icons.
useStatusText Boolean false Displays node names in the statusbar instead of the url.
closeSameLevel Boolean false Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.
inOrder Boolean false If parent nodes are always added before children, setting this to true speeds up the tree.


[附录]

target属性指定所链接的页面在浏览器窗口中的打开方式,它的参数值主要有:_blank、_parent、_self、_top:

◎_blank,在新浏览器窗口中打开链接文件。

◎_parent,将链接的文件载入含有该链接框架的父框架集或父窗口中。如果含有该链接的框架不是嵌套的,则在浏览器全屏窗口中载入链接的文件,就象_self参数一样。

◎_self,在同一框架或窗口中打开所链接的文档。此参数为默认值,通常不用指定。
但是我不太理解
◎_top,在当前的整个浏览器窗口中打开所链接的文档,因而会删除所有框架
排行榜 更多 +
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载
几何飞行安卓版

几何飞行安卓版

飞行射击 下载