[Dojo-interest] Changing a custom widget style programmatically
robert.coup at onetrackmind.co.nz
Mon Nov 6 13:02:21 MST 2006
Yoav Rubin wrote:
> I created a custom widget (actually i just tweaked the memo widget
> from the dojo book), but i can't find a way to change it's appearance
> programmatically. In the memo example if the user presses on the 'X'
> the memo is closed, i need somehow to access the widget's style and
> change it's border when cursor is above the widget. So i attached to
> the widget the onmouseover event, and the function is called properly,
> but i can't change the border, because the change doesn't reflect on
> the displayed widget.
> Does anyone has any idea what to do
You can look at the widget and see the HTML template structure...
<div class="close" dojoAttachEvent="onClick">X</div>
<div class="contents" dojoAttachPoint="containerNode"></div>
The outer node is usually available via .domNode, and any others are
connected via dojoAttachPoint. So in the above example .containerNode
will also be valid.
So the easiest case may be:
this.domNode.style.border = "2px solid red";
One Track Mind Ltd.
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Mobile +64-21-572 632
More information about the Dojo-interest