|
|
|
[
Permlink
| « Hide
]
Jim Eng - 30-Aug-2007 11:02
Colin, Any advice on using the dojo widget in place of the current widget used for the "add" and "actions" menus in resources?
Hi Jim,
Definitely worth using the 0.9 release now that it's out, rather than the beta: http://download.dojotoolkit.org/release-0.9.0/ Another bit of advice when using Dojo: instantiate your widgets programmatically.
Dojo's default model involves adding "dojo" attributes to the elements in your document as place-holders. At runtime, Dojo will scan the whole DOM looking for these attributes and instantiating the actual widgets itself. In a portal environment, this can be problematic. Our approach has been to instantiate Dojo widgets programatically. Here is some documentation on how to do so: http://tinyurl.com/28ljvt In short, it's as simple as calling the standard widget constructor, passing it: 1) any parameters to your widget, including its labels and so on, and 2) the id of the DOM node to which it should be attached. Pretty straightforward. To invoke this, we tend to include a <script> tag in the document immediately following the DOM element that calls a single-line initialization method. For the Lightbox, it looks something like this: <script> initLightbox(params, "lightbox"); </script> In the case of the Resources tool, since you'll have potentially many buttons on the page at once, you may want to roll the instantiation of them all into a single call. Anyway, this approach of programmatically instantiating Dojo widgets and using a simple script tag to do so will ensure that your use of Dojo is self-contained and portal-friendly. Here is some more documentation on the Dojo button-related widgets: http://tinyurl.com/25p6qe |
|||||||||||||||||||||||||||||||||||||||||||||||||