Opened 8 years ago

Closed 3 years ago

#13098 closed enhancement (patchwelcome)

dojox.gfx enhancement to provide serialised dojo.connect support

Reported by: Kitson Kelly Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: DojoX GFX Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

I had a requirement to server side generate a complex graphic and used dojox.gfx to provide a serialised version of the diagram via an XHR GET to the browser and then deserialise via the dojox.gfx.utils. One of the things that I needed to do though was create hyperlinks on certain parts of the graphic. Therefore I created the support to provide a "connect" as a valid parameter of a gfx serialised object. For example:

{
    "connect": [
        {
            "event": "onclick",
            "content": "log.console('I was clicked!');"
        },
        {
            "event": "onmouseover",
            "content": "this.style.cursor=\"pointer\""
        }
    ]
}

I have included my recommended patch to the dojox.gfx.utils. My CLA is on file with the foundation.

Attachments (1)

utils.js.patch (937 bytes) - added by Kitson Kelly 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by Kitson Kelly

I am updating the patch to support the inclusion of "args" to be passed to upon the creation of the connection. For example:

{
  "connect": [
    {
      "event" : "onclick",
      "args" : [ "evt" ],
      "content" : "log.console('I was clicked!');"
    }
  ]
}

Will perform a

shape.connect("onclick",new Function("evt","log.console('I was clicked!')"));

Changed 8 years ago by Kitson Kelly

Attachment: utils.js.patch added

comment:2 Changed 8 years ago by Eugene Lazutkin

Component: GeneralDojoX GFX
Owner: set to Eugene Lazutkin
Type: defectenhancement

comment:3 Changed 3 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given the changes over the past few years, I'm assuming this isn't worth landing at this time. Feel free to open as a PR if you think there's still value with this change. Thanks!

Note: See TracTickets for help on using tickets.