ASP.NET TreeView - Client-Side Functions

Tutorial 4 of 4


Tutorial 1               Tutorial 2               Tutorial 3               Tutorial 4


·ob_getExpanded (node_object, onlyChildren)
    Returns a comma delimited list of all the ids of the expanded nodes.
If node_object is specified and not null, it will only search the subnode list of node_object, otherwise it will start with the first node in the tree.
If onlyChildren is specified and is true, it will only search in node_object's children list and not below it, otherwise it will go all levels deep as available.

·ob_getCollapsed (node_object, onlyChildren)
    Returns a comma delimited list of all the ids of the collapsed nodes.
If node_object is specified and not null, it will only search the subnode list of node_object, otherwise it will start with the first node in the tree.
If onlyChildren is specified and is true, it will only search in node_object's children list and not below it, otherwise it will go all levels deep as available.

·ob_tall(exp)
    Expands / collapses all nodes of the TreeView.

·ob_expandSingle(node)
    Allows only one node for each level to be expanded.

·ob_nodeEnsureVisible(node)
    Ensures that the node is in the visible area.
This function is called automatically when selecting a node.


Hello, I am Root node!
obout.com Home
ASPTreeView
Small
Fast
Easy
More nodes
Different color
Any HTML
Select Icons
Memobook
Recycle :)
Right-click on each node to test. An Easy Menu will be shown with 6 options.

It is the same Easy Menu, attached to each node.

(You can see our example of TreeView with Easy Menu for details).



The code for OnClientClick of the second menuItem is as follows:

    OnClientClick="try {alert(ob_getCollapsed(document.getElementById(tree_selected_id)),false);} catch (e) {}"

That is equivalent to:
    OnClientClick="// Get selected node.
var SelectedNode = document.getElementById(tree_selected_id);

// Get the list of collapsed sub-nodes of SelectedNode from all levels deep as available.
var List = ob_getCollapsed(SelectedNode,false);

// Alert the list.
alert(List);"


 
obout.com
obout.com Home
News
TreeView Home
TreeView Home
Download
Site Map
Examples 
Styles
Classic
Classic
Dynamic Loading
No Icons
Black
Black No Icons
Background image
Premiere New
black
blue
green
red
violet
yellow
Explorer
Gray
Help
HelpPlus
MSDN
TMenu
TMenu (small icons)
Vista New
Web
White
XPBlue
Win2003
Right To Left
Features
Drag and drop - 18
Drag-n-Drop
Custom
Multi-node
Dragging with children
Drop in textboxes
External D'n'D
Move nodes 1
Renumber nodes
Auto Scrolling
Copy / Move nodes
D'n'd and Dynamic Loading
Drop in listboxes
Drop in listboxes 2
Restrict Levels
D'n'D with various options
Disable dropping in two trees
Not-allowed Icon New
Sort after D'n'D New
Dynamic loading - 6
Web style
MSDN style
Deep tree
Reload subtrees
Loading trees partially
Virtual Scrolling New
Add/remove nodes - 4
Add/remove on client-side
Alphabetical order
Add to dynamic subtrees
Remove all children
Edit nodes - 4
Edit nodes
Nodes with Checkboxes
Sort after Edit New
Select nodes - 3
Find selected node
Select multiple nodes
Highlight parent
Layout - 2
Width, height and scrollbars
Root node
TreeView state - 3
Dynamic
Keep expanded
Keep collapsed
File system - 3
Show file system
File system loading
File system manager
Additional data for each node - 3
Details
On client side
Image viewer
Expand/collapse nodes - 2
By level
Single folder
Multiple trees - 4
Two Trees
Two Trees custom
Two Trees enhancement
Move Nodes BTWN Trees New
Different Styles New
Validation - 2
D-n-d on server
Edit on server
Integration - 14
With a context menu
Attach Easy Menu
Attach menu on-demand
Attach to dynamic nodes
Attach menu to icons
Change icons
With Flyout
With Splitter
MS AJAX
With checkboxes
Dynamic checkboxes
With a Combobox
With modal dialog
Outlook Slide Menu
With Tab Strip
Build from SiteMap
Customization - 7
Icons for treeview
Aligned columns
CSS Tutorial
Hover node effect
Multi-Level Slide Menu
Select on Collapse
From Dennis
From/To XML file
Keyboard navigation
Search nodes
Client-side events
Knowledge Base - 1
Knowledge Base
Documentation
Method Add
Server-Side
Client-Side
Client-Side Events
XML
Methods
XML Tutorial
Client-Side Tutorial
Tutorial 1
Tutorial 2
Tutorial 3
Tutorial 4
Events
Tutorial
Event handlers
Tutorials
Using the correct path
Improving performance
In a user control
AutoPostBack with various options
Open in Search pane
Move nodes by clicking a button
Postback on node select
Switch icons