documentation.xml
5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="../documentation.xsl"?>
<?xml-stylesheet href="../documentation.xsl" type="text/xsl" media="screen"?>
<doc xml:whitespace="preserve">
<assembly>
<name>jsUI-Treeview</name>
<code>
<c>var mytreeview = new Object();</c>
<c>mytreeview = treeviewNew("mytreeview", "default", document.getElementById("treeCell"), null);</c>
<c>mytreeview.itemClick = doClick;</c>
<c>mytreeview.itemExpand = loadBranch;</c>
<c>mytreeview.createItem("item1", "First Item", "../images/icon.jpg", true, true, true, null);</c>
<c>mytreeview.createItem("item1-1", "First Item Child", "../images/icon.jpg", true, true, true, "item1");</c>
</code>
<remarks>The treeview is a nested navigation control, based on those frequently found in Windows or the MacOS. It is compatible with Internet Explorer 5.0 and FireFox 1.0 or better.</remarks>
<requirements>
<para>jsUI-Global/common.js</para>
<para>jsUI-Global/uiCommon.js</para>
<para>jsUI-Treeview/component.js</para>
</requirements>
<sample>index.htm</sample>
</assembly>
<Property>
<member name="treeviewParent">
<summary>The DOM object to which the treeview is attached. Frequently a DIV or TD.</summary>
<code>alert (mytreeview.treeviewParent.id);</code>
<remarks>DOM Object. This property is assigned on instantiation and is read only.</remarks>
</member>
<member name="rootDir">
<summary>Gets or sets the string value representing the path to the root of the jsObjects directory. Used for calculating style and graphics file paths. Initially set during instantiation.</summary>
<code>mytreeview.rootDir = "http://localhost/libraries/jsobjects";</code>
<default>http://<server>/jsObjects</default>
<remarks>String. This value only needs to be set if jsObjects is installed in a custom location.</remarks>
</member>
</Property>
<Method>
<member name="treeviewNew (string, string, object, string)">
<summary>Instantiates the treeview through assignment into a Javascript object.</summary>
<param name="treeviewName">Required. The name for the new treeview. Must match the name of an empty Javascript object to contain the treeview.</param>
<param name="skinName">Optional. The name of the CSS (excluding the extension and path) file to use for the treeview. If left blank, "default" will be used.</param>
<param name="treeviewParent">Optional. The DOM object that the treeview is to be attached to. If no value is passed, the treeview will be appended to document.body</param>
<param name="rootDir">Optional. The path to the root of the jsObjects directory. If left blank, the default path will be used.</param>
<code>
<c>var mytreeview = new Object();</c>
<c>mytreeview = treeviewNew("mytreeview", "default", document.getElementById("treeviewDiv"), "../jsobjects");</c>
</code>
<returns>The treeview object.</returns>
<remarks>This is the only method that does not appear to be a member of the object -- because the object can't have members until it's instantiated. A blank object is created and will be filled with the jsUI-treeview members.</remarks>
</member>
<member name="createItem (string, string, string, boolean, boolean, boolean, string)">
<summary>Creates a branch icon in the specified folder in the treeview.</summary>
<param name="itemID">Required. A unique string to be used as the DOM ID for the new tree item.</param>
<param name="itemName">Required. The text that appears as the title of the new tree item.</param>
<param name="itemImg">Optional. The icon for the new tree item.</param>
<param name="hasChildren">Required. Indicates whether or not there are children below the new tree item. If null is passed an "indeterminate" indicator is used to show the user that the heirarchy is not known until the item is expanded.</param>
<param name="preload">Required. Indicates whether or not the item has been pre-loaded. This is used to determine the show/hide behaviour of children. If a nodes children are populated by a local function, then preload is false, since that function can be called to re-populate the branch next time it is expanded. If, however, the branch was pre-loaded by server-side code, or some non-local function, the parent node's heirarchy will be preserved -- hidden and shown, on collapse/expand -- instead of being destroyed and re-created.</param>
<param name="show">Required. Determines whether or not to show the item on the tree. If the item is a child of an un-expanded parent, then show should be false.</param>
<param name="parentID">Required. The parent item to add the new item to. If omitted, the new item will be appended to the root item of the tree, or the last item on the root level.</param>
<code>mytreeview.createItem("item1", "First Item", "../images/icon.jpg", true, true, true, null);</code>
<returns>Nothing</returns>
</member>
</Method>
<Event>
<member name="itemClick">
<summary>Fires whenever a item is clicked, passing the ID of target object, so that external code can respond.</summary>
<code>
mytreeview.itemClick = <i>handler</i>;
</code>
<remarks>The handler should accept one string parameter which will contain the ID of the button clicked.</remarks>
</member>
<member name="itemExpand">
<summary>Fires whenever a tree branch expand action happens, passing the ID of target object, so that external code can respond by populating the target node's children.</summary>
<code>
mytreeview.itemExpand = <i>handler</i>;
</code>
<remarks>The handler should accept one string parameter which will contain the ID of the button clicked.</remarks>
</member>
</Event>
</doc>