treenode
| Name space |
rialto.widget |
| FILE |
rialtoEngine\javascript\components\controls\treeview.js |
| NAME |
treenode |
| INHERITS |
AbstractComponent
|
| VERSION |
0.86 |
| update |
|
| DESCRIPTION |
This object create a create tree node |
CONSTRUCTOR
| Name |
Type |
Description |
Default |
| name |
String |
Name of the treenode |
|
| text |
String |
text of the treenode |
|
| icon |
String |
path of an image (19*23) to symbolize the node |
"images/imTreeview/pict_synthetik_off.gif" |
| icon2 |
String |
path of an image (19*23) to symbolize the node when open |
sIcon |
| onclick |
String |
name of the function to call when clicking the node |
toggle function |
| open |
boolean |
initial statute of the node (open or not) |
true |
| reload |
boolean |
Node is reloadable using url attribute |
false |
| url |
string |
url called to get the new value of the node |
true |
| draggable |
boolean |
indicate if this node can be drag in a draggable treeview. |
true |
Example:
node1 =new rialto.widget.TreeNode({
name:'node1',
text:'1',
icon:'images/imTreeview/pict_synthetik_off.gif',
icon2:'images/imTreeview/pict_synthetik_on.gif',
onclick:"loadLayout('demoSplit')",
open:true,
reload:false,
url:"",draggable:false}
);
PUBLIC METHODS
refreshReloadNode
will add a new node to the one which has been reloaded
Parameters:
Object treeNode node:node to add
toggle
this method will open or close the node. If it is a reloadable node the url for the reload is call.
Parameters:
String nodeId:id of the node in which we want to add the new node
object objPar:object use for the treeNode constructor
existChild
return true if the node has children with this id
Parameters:
String idNode:id of the node we are looking for
hasChild
return true if the node has children
Parameters:
addNode
add a node
Parameters:
Object treeNode node:child node to add
insertBefore
insert a node before
Parameters:
Object treeNode node:node to insert
removeNode
remove a child node
Parameters:
String nodeId:id of the child node we want to remove
setText
this method will allow to change the text of the label node
Parameters:
String newText:new text of the label node
isFirst
return true if the node is the first children of his parent
Parameters:
isLast
return true if the node is the last children of his parent
Parameters:
first
return the first children of the node
Parameters:
last
return the last children of the node
Parameters:
next
return the next brother of the node
Parameters:
previous
return the previous brother of the node
Parameters:
setStyle
this method will allow to change any style attribute of the node label
Parameters:
object objeStyle:object which properties reperesents style properties to set
onclick
this method will be raise after clicking the node.
Parameters:
The code must be redefine after the instanciation of the component. By default this method does nothing.