[Dojo-interest] Links in dojox.gfx JSON

Kitson Kelly kitson.kelly at asseverate.co.uk
Tue Mar 16 13:48:07 EDT 2010


I took a look at dojox.gfx.utils.deserialize and it is obvious from that
code there is no way to specify an event handler.  In theory it would be an
easy thing to add to the serialization/deserialization of a gfx object.

I think I am going to have to create my own workaround with the JSON that I
return that will allow my code to iterate through and do the dojo.connect on
each node.

I would consider filing it as a feature request and maybe even taking a shot
at generating a patch to the dojo.gfx.utils myself, but I haven't been able
to logon to dojo Trac (http://bugs.dojotoolkit.org/) for like two weeks.
Anyone know what is going on there, or is it just me?

On 16 March 2010 13:41, Kitson Kelly <kitson.kelly at asseverate.co.uk> wrote:

> I have had some good experience so far translating some SVG generating code
> to dojox.gfx JSON, but I am a bit stuck on a way to generate a "link" in the
> serialized JSON to be read by dojox.gfx, or is this even possible?  I would
> really really like to have a way to put it into the JSON directly since that
> is how I am dynamically generating the diagram.
>
> I tried adapting the "dojox/gfx/demos/creator.html" by adding the following
> object to the page, and seeing what the serialized version, but noticed that
> while all the other stuff is there, it doesn't appear to have anything for
> the .connect:
>
> var t1 = surface.createText({width: 100, height: 30, text: "Foo"})
> .setFont({family:"Arial",size:"9pt",weight:"normal"})
> .setFill("black")
> .setStroke("black")
> .connect("onclick",function(evt){
> console.log("did this work?");
> });
>
> --
> Asseverate Limited (Registration No. 6964209) is a limited company
> incorporated in England and Wales with its registered office at 149A Bedford
> Hill, London, SW12 9HF.
>



-- 
Asseverate Limited (Registration No. 6964209) is a limited company
incorporated in England and Wales with its registered office at 149A Bedford
Hill, London, SW12 9HF.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20100316/97aee72d/attachment.htm 


More information about the Dojo-interest mailing list