Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:12:25+00:00 2026-05-30T08:12:25+00:00

I am working with dojo editor. And I have a problem so could you

  • 0

I am working with dojo editor. And I have a problem so could you help me to solve this
problem.

My problem is: how can I add event listener to tag that I input to the editor such as onClick, onMouseover, etc…

For Example : I input an image tag to the editor content:

var ed=dijit.byId("myEditor"); //my editor has id id myEditor
var img = "<img src='myPic.jpg' alt='' id='myPic'/>"; //my image tag
ed.forcus();
ed.execCommand("inserthtml", img); //insert image tag into editor content

After inserting image tag to the editor, now I want to add “click” event to it, because i want click that image and a small tooltip showed to choose align that image left or right.

Thanks for any suggestion!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:12:27+00:00Added an answer on May 30, 2026 at 8:12 am

    Check out my jsFiddle example: http://jsfiddle.net/phusick/j475Q/

    Basically the node you want to connect is editor.editNode:

    var editor = dijit.byId("editor");
    dojo.connect(editor.editNode, "ondblclick", this, "_onDblClick"); 
    

    Afterwards, in _onDblClick method you have to find out which kind of node was dblclicked and decide whether to proceed with an action:

    _onDblClick: function(e) {
        var target = e.target;
        var tag = target.tagName ? target.tagName.toLowerCase() : "";
        if(tag == "img") {        
            dojo.withGlobal(editor.window, "selectElement", selectionapi, [target]);
        }
    }
    

    I found this in the LinkDialog plugin (dijit/_editor/plugins/LinkDialog.js). Look there for more inspiration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some code I am working with replaces some HTML elements that have Dojo event
I have a set of items that can be dragged / dropped using Dojo
I have a working chart that graphs sales by week. I'd like to add
For whatever reason, this little piece of dojo isn't working. I have to admit
I can't get my dojo working. I've tried everything. Here is the code: <!DOCTYPE
I am currently working on a project that is using Dojo as the js
I have Aptana installed within Eclipse. I'm working on a project with the dojo
I am working on a web page that uses dojo and has a number
Could someone please explain to me why this simple straight forward code isnt working,
I'm working on some project that uses Dojo dijit.form.Select , that produce some really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.