| Issue 426: | Add multiple actions to node title | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Hi,
I am not sure if this is requested before or not.
I am trying to add a clickable image next to the title in a node.
Clicking on node title will have different action than clicking on the image.
var node = {
title:'label' //want to add an image that will have different action than title click
expand:true,
icon:false,
noLink:false,
children:[],
};
I am using jquery.dynatree-1.2.4.js on windows 7
What DOCTYPE declaration are you using?html
Currently, i tried to add image by adding a <div><img> tag. This is giving me the image in next line.
Somewhere i read you can add two actions at node title using span tag, but i couldn't figure out how to do it. Can you please suggest?
Thanks
May 15, 2013
I did the below for positioning and works great
event.target.offsetLeft,
event.target.offsetTop
I add the popup div to dynatree like below
appendTo($("#tree").find("span.dynatree-node"));
Please close the issue
May 16, 2013
thanks for the feedback
Status:
Done
Labels: Milestone-Release1.2.4 |
I was able to add the image by doing as below. I found this piece of code on discussion boards. It works. However, my popup div on click of the image is not positioning at the mouse click. It goes off the page and adds scroll bar. left:event.pageX, top:event.pageY, position: "absolute" any suggestons? var postImg = document.createElement('img'); postImg.setAttribute('src', imagesFolder + "down_arrow.png"); postImg.setAttribute('id', "image"+node.data.xxxNode.attributes.ID); postImg.setAttribute('class', "image_style"); $(span).find('.dynatree-title').after(postImg);