Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1450 closed enhancement (fixed)

[patch][cla]Add ID to fisheyelistitem

Reported by: guest Owned by: dylan
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

If I connect the following navigate function to the onClick event of a Fisheyelistitem, I cannot get the id. But this would be very useful to react on the onclick event and to choose where to navigate. The example in the Demo, specifies a onClick in each item which is redundant and does break the dojo event approach.

<div id="listCustomer" class="dojo-FisheyeListItem?"

dojo:iconsrc="images/list_customer.png" caption="List customer">

</div>

function navigate(event){

dojo.debug("load: "+event); var target = dojo.html.getEventTarget(event); var parent = target.parentNode; dojo.debug("id: "+ parent.id);

}

To make the navigate function work, we would need the folling patch. I am starting with Dojo so please review the patch carefully.

Best Regards Sebastian Contact me with the contact form on http://www.laliluna.de

Index: C:/work/dojo/src/widget/FisheyeList.js =================================================================== --- C:/work/dojo/src/widget/FisheyeList.js (revision 5681) +++ C:/work/dojo/src/widget/FisheyeList.js (working copy) @@ -613,6 +613,8 @@

iconSrc: "", svgSrc: "", caption: "",

+ will be set to the id of the orginal div element + id: "",

blankImgPath: dojo.uri.dojoUri("src/widget/templates/images/blank.gif"),

@@ -635,9 +637,21 @@

this.domNode.appendChild(this.svgNode); this.imgNode.style.display = 'none';

} else if((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4)==".png")&&(dojo.render.html.ie)&&(!dojo.render.html.ie70)){

+ /* we set the id of the new fisheyeListItem to the id of the div defined in the HTML */ + if (dojo.dom.hasParent(this.imgNode) && this.id != ""){ + var parent = this.imgNode.parentNode; + parent.setAttribute("id", this.id); + } +

this.imgNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='scale')"; this.imgNode.src = this.blankImgPath.toString();

} else {

+ /* we set the id of the new fisheyeListItem to the id of the div defined in the HTML */ + if (dojo.dom.hasParent(this.imgNode) && this.id != ""){ + var parent = this.imgNode.parentNode; + parent.setAttribute("id", this.id); + } +

this.imgNode.src = this.iconSrc;

}

Attachments (1)

patch.txt (1.4 KB) - added by guest 13 years ago.
SVN patch made with subclipse

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by guest

Attachment: patch.txt added

SVN patch made with subclipse

comment:1 Changed 13 years ago by dylan

Milestone: 0.5
Summary: Add ID to fisheyelistitem[patch][need cla]Add ID to fisheyelistitem

Sent email to Sebastian asking for a CLA...

comment:2 Changed 13 years ago by dylan

Milestone: 0.50.4
Owner: changed from bill to dylan
Status: newassigned
Summary: [patch][need cla]Add ID to fisheyelistitem[patch][cla]Add ID to fisheyelistitem

comment:3 Changed 13 years ago by dylan

Resolution: fixed
Status: assignedclosed

(In [5698]) fixes #1450, Add ID to fisheyelistitem, thanks for the patch

comment:4 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.