Action

Indicates the action you want DBTree to do. Possible actions are:

action="get" (default)

Use this action if you want to output data. The action attribute is always required and the action get also needs the type attribute (type of the output).
Possible types of output are: list (default), linked, clicktree, hovertree, path, select and checkbox. For more information about the attribute type click here.
To output data with the get action, you can use the results from cfquery.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password" 
table="table name"
action="get"
type="list"
id="column name"
parent="column name"
contentfield="column name">

Data from cfquery:

<cf_dbtree
query="queryname"
action="get"
type="list"
id="column name"
parent="column name"
contentfield="column name">

[ Up ]

action="edit"

This creates an unordered list for modifiying the data structure. Required for this action is the attribute editpage and the attribute type wich should be either "simple" or "advanced". Also required is at least one of the buttons.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
id="column name"
parent="column name"
contentfield="column name"
action="edit"
type="simple / advanced"
editpage="path to your edit page"
btn_addroot="[create new rootnode]"
btn_moveroot="[move to root]"
btn_add="[add]"
btn_edit="[edit]"
btn_delete="[delete]"
btn_up="[up]"
btn_down="[down]">

[ Up ]

action="insert"

Use this action to insert a new record. In this case, the node attribute represents the parent-node of the new record. Set node=0 if you want to create a new root node (wich will write parent_id=0 to the database).

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="insert"
node="nodeid"
id="column name"
parent="column name"
formfields="field1,field2,field3,...">

[ Up ]

action="update"

Use this action to update the fields of a record. In this case, the node attribute is the ID of the record to update.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="update"
node="nodeid"
id="column name"
parent="column name"
formfields="field1,field2,field3,...">

[ Up ]

action="delete"

This action is used to delete a given node with all its subnodes.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="delete"
id="column name"
parent="column name"
node="nodeid">

[ Up ]

action="up"

This action moves the given node one position upwards in its level.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="up"
id="column name"
parent="column name"
node="nodeid">

[ Up ]

action="down"

This action moves the given node one position downwards in its level.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="down"
id="column name"
parent="column name"
node="nodeid">

[ Up ]

action="move"

This action moves the given node under a given target node (nodeto).

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="move"
id="column name"
parent="column name"
node="node id to be moved"
nodeto="target node id, where to place the node">

[ Up ]

action="moveroot"

This action moves the given node to the root level at the last position.

<cf_dbtree
datasource="datasourcename"
username="username"
password="password"
table="table name"
action="moveroot"
id="column name"
parent="column name"
node="nodeid">

[ Up ]

 

 

Add your comment to this page Add Comment
Join for a free account, or login if you are already a member.