getTextTop
string getText()
Get a node text content.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get content of "software" node
var content = kTree.getNode("software").getText();
}
</script>
Supported from version: 2.0.0.0
setTextTop
string setText(string content)
Get a node text content.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Set content to "software" node
kTree.getNode("software").setText("My software");
}
</script>
Supported from version: 2.0.0.0
getImageSrcTop
string getImageSrc()
Get src of image in a node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get content of "software" node
var src = kTree.getNode("software").getImageSrc();
}
</script>
Supported from version: 2.0.0.0
setImageSrcTop
void setImageSrc(string imageSrc)
Set src to the image of a node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Set content to "software" node
kTree.getNode("software").setImageSrc("images/folder.gif");
}
</script>
Supported from version: 2.0.0.0
getDataTop
string getData(string key)
Get node attached data.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get data of "software" node
var data = kTree.getNode("software").getData("name");
}
</script>
Supported from version: 2.0.0.0
addDataTop
string addData(string key, object value)
Add data to the node. Simply providing the key and the value, the data will be saved and retrieve later by getData function.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get data of "software" node
var data = kTree.getNode("software").addData("name","John");
alert(kTree.getNode("software").getData("name"));
}
</script>
Supported from version: 2.0.0.0
getTreeTop
KoolTreeView getTree()
Get tree object of the node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get the tree of the node
var tree = node.getTree();
}
</script>
Supported from version: 2.0.0.0
moveToAboveTop
void moveToAbove(string NodeId)
Move the node to above a node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Move "software" node above "hardware" node.
kTree.getNode("software").moveToAbove("hardware");
}
</script>
Supported from version: 2.0.0.0
moveToBelowTop
void moveToBelow(string NodeId)
Move the node to above a node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Move "software" node bellow "hardware" node.
kTree.getNode("software").moveToBelow("hardware");
}
</script>
Supported from version: 2.0.0.0
isSelectedTop
bool isSelected()
Check whether the node is selected
Show/Hide Code
<script type="text/javascript">
function foo()
{
if (kTree.getNode("software").isSelected()==true)
{
alert("Software node is selected");
}
}
</script>
Supported from version: 2.0.0.0
isExpandedTop
bool isExpanded()
Check whether the node is expanded
Show/Hide Code
<script type="text/javascript">
function foo()
{
if (kTree.getNode("software").isExpanded()==true)
{
alert("Software node is expanded");
}
}
</script>
Supported from version: 2.0.0.0
startEditTop
void startEdit(string initContent)
Start editing the node. If the initContent is specified, the node will be started edit with initContent string.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Make "software" node start editing.
kTree.getNode("software").startEdit();
}
</script>
Supported from version: 2.0.0.0
endEditTop
void endEdit(bool updated)
End editing the node, if the updated is true, content will be updated. If updated is false, update node content will be cancelled
Show/Hide Code
<script type="text/javascript">
function foo()
{
//End editing action and update the node content.
kTree.getNode("software").endEdit(true);
}
</script>
Supported from version: 2.0.0.0
expandTop
void expand()
Expand a node
Show/Hide Code
<script type="text/javascript">
function testTreeView()
{
// Expand the "software" node
kTree.getNode("software").expand();
}
</script>
Supported from version: 2.0.0.0
collapseTop
void collapse()
Collapse a node
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Collapse the "software" node
kTree.getNode("software").collapse();
}
</script>
Supported from version: 2.0.0.0
selectTop
void select()
Select a node
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Select the "software" node
kTree.getNode("software").select();
}
</script>
Supported from version: 2.0.0.0
unselectTop
void unselect()
Unselect a node
Show/Hide Code
<script type="text/javascript">
function foo()
{
// unselect the "software" node
kTree.getNode("software").unselect();
}
</script>
Supported from version: 2.0.0.0
getParentIdTop
string getParentId()
Return the parent id of a node
Show/Hide Code
<script type="text/javascript">
function testTreeView()
{
//Get the id of parent node of the "software" node
var parentid = kTree.getNode("software").getParenId();
}
</script>
Supported from version: 2.0.0.0
getChildIdsTop
array getChildIds()
Return array of child ids of a node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Return all child id under node "node1"
var childList = kTree.getNode("software").getChildIds();
for(var i=0;i<childList.length;i++)
{
alert(childList[i]);
}
}
</script>
Supported from version: 2.0.0.0
attachToTop
void attachTo(string NodeId)
Attach this node to another node
Show/Hide Code
<script type="text/javascript">
function foo()
{
kTree.getNode("software").attachTo("computer");
}
</script>
Supported from version: 2.0.0.0
loadSubTreeTop
void loadSubTree(string url)
Load a subtree to node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Dynamic load subtree for "software" node
kTree.getNode("software").loadSubTree("subtree.php");
}
</script>
Supported from version: 2.0.0.0
disableSelectTop
void disableSelect(bool disable)
Set whether a node is select-disable. Collapse
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Disable the selection for "software" node
kTree.getNode("software").disableSelect(true);
}
</script>
Supported from version: 2.0.4.0
disableDragTop
void disableDrag(string disable)
Set whether a node is select-disable.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Disable the dragging for "software" node
kTree.getNode("software").disableDrag(true);
}
</script>
Supported from version: 2.0.4.0
disableDropTop
void disableDrop(bool disable)
Set whether a node is select-disable.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Disable the dropping for "software" node
kTree.getNode("software").disableDrop(true);
}
</script>
Supported from version: 2.0.4.0
disableEditTop
void disableEdit(bool disable)
Set whether a node is select-disable.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Disable the editing for "software" node
kTree.getNode("software").disableEdit(true);
}
</script>
Supported from version: 2.0.4.0
addChildNodeTop
void addChildNode(string id, string text, string imagesrc)
Add a new sub node to this node.
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Add a new subnode "Window Vista" to current "software" node
kTree.getNode("software").addChildNode("win","Window Vista","images/vista.gif");
}
</script>
Supported from version: 2.0.4.0