Mixing Widgets into an HTML Page: Difference between revisions
mNo edit summary |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]] | {{Archive}}[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]] | ||
== HTML == | == HTML == | ||
Line 41: | Line 41: | ||
toolbar.reparentHtmlElement(div); | toolbar.reparentHtmlElement(div); | ||
</pre> | </pre> | ||
{{Article Footer|unknown|4/19/2006}} | |||
[[Category:Zimbra AjaxTk]] |
Latest revision as of 12:28, 24 March 2015
- This is archive documentation, which means it is not supported or valid for recent versions of Zimbra Collaboration.
Zimbra AjaxTk->DHTML Widget Toolkit->Widgets
HTML
<h1>Menu Test</h1> <div id="menu_bar"> & nbsp; </div> <!-- menu_bar -->
Set up the Shell
Must set to virtual
var shell = new DwtShell("MainShell", true, null, null, true);
shell.setVirtual();
Putting a Widget in a <div>
To put a Dwt widget in a <div>
, you need to get the document element of the <div>
, clear the contents and then reparent the Dwt widget in the element. Here is an example of how to do that.
// create a toolbar var toolbar = new DwtToolBar(parent, "mainMenu", DwtControl.ABSOLUTE_STYLE, 2); /* ... Here we would have the code to add buttons to the toolbar */ // Get the div into which we want to place the toolbar var div = document.getElementById("menu_bar"); // Clean out any content div.innerHTML = ""; // Reparent the toolbar's HTML element to the div toolbar.reparentHtmlElement(div);