MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual page 123

Extending dreamweaver
Table of Contents

Advertisement

The following example adds a node to the top level of a tree:
var tree = document.myTreeControl;
//add a top-level node to the bottom of the tree
tree.innerHTML = tree.innerHTML + '<mm:treenode name="node3"¬
value="node3">';
Adding a child node
property of the selected node.
The following example adds a child node to the currently selected node:
var tree = document.myTreeControl;
var selNode = tree.selectedNodes[0];
//deselect the node, so we can select the new one
selnode.removeAttribute("selected");
//add the new node to the top of the selected node's children
selNode.innerHTML = '<mm:treenode name="item10" value="New item11" ¬
expanded selected>' + selNode.innerHTML;
Deleting nodes
To delete the currently selected node from the document structure, use the
or
innerHTML
outerHTML
The following example deletes the entire selected node and any children:
var tree = document.myTreeControl;
var selNode = tree.selectedNodes[0];
selNode.outerHTML = "";
A color button control for extensions
In addition to the standard input types such as text, checkbox, and button, Dreamweaver
supports
mmcolorbutton
Specifying
<input type="mmcolorbutton">
the UI. You can set the default color for the color picker by setting a value attribute on the
input tag. If you do not set a value, the color picker appears grey by default and the value
property of the input object returns an empty string.
The following example shows a valid
<input type="mmcolorbutton" name="colorbutton" value="#FF0000">
<input type="mmcolorbutton" name="colorbutton" value="teal">
A color button has one event,
To add a child node to the currently selected node set the
properties.
, an additional input type in extensions.
mmcolorbutton
, which is triggered when the color changes.
onChange
in your code causes a color picker to appear in
tag:
Using custom UI controls in extensions
innerHTML
123

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Dreamweaver 8

Table of Contents