cssinternet-explorerdojox.gfx

Dojo GFX widgets displaying float-like behaviour instead of correct positioning


I'm using Dojo GFX to do some simple drawing, but having a problem with IE 7/8 (switching browsers is not an option).

If I create a div, set up a surface and draw some rects, they draw correctly relative to the div, so far so good.

However, what I want to do is create a widget, something with an embedded 'surface' that draws based on some widget-specific data. As such, I have a widget that contains a div, and I draw into this div. When I do that, the rects I create behave as if they are responding to a float:right, appearing in order they are created and ignoring the 'x' parameter.

I assume that this behaviour is something to do with CSS, but I haven't got to the bottom of it yet. Any ideas or solutions gratefully appreciated!


Updates:


Solution

  • It seems that if you are going to use Dojo GFX and draw on DOM elements that are created as part of a widget in IE7/8, you must actually do the drawing in an override of the startup() method.

    Drawing in the postCreate() method causes incorrect rendering resembling a float: left.