Shape parameters
Thursday January 11th 2007 ..
Filed under: Ajax

To change a shape parameters, say, a line, use:

line.setShape({x1: 0, y1: 0, x2: 20, y2: 20})

Too bad this isn’t present in any documentation that I could find!!!
BTW, gfx.Shape API is nowhere to be seen! It makes it really hard to code this way…

Comments Off


Dojo: shape border
Thursday January 04th 2007 ..
Filed under: Ajax

After getting a shape pointer, change its border color and width like this:


var shape = getShape(event);
shape.setStroke({color: "red", width: 2});

Comments Off


Dojo: ContentPane
Thursday January 04th 2007 ..
Filed under: Ajax

When getting a widget by id, I should use:

dojo.widget.byId(_id_)

Despite this being a rule, I came across the stupid behavior, just as follows:

<script>
container = dojo.byId("gfx_holder");
warning_container = dojo.widget.byId("upper_menu");
</script>
<html>
<div id="gfx_holder" dojoType="ContentPane" ...
<div id="upper_menu" dojoType="ContentPane" ...
</html>
</div></html></code>

container does not work if dojo.widget.byId is used.
warning_container does not work if dojo.byId is used.

So I need to remember to USE BOTH METHODS...

Comments Off