Image ID

Nov 21, 2009 at 10:28 PM

Hi, is there a way to set the Image ID of the image in an <ext:image control? I am implimenting a image crop feature and I need to pass the actual id of the img tag.


Nov 22, 2009 at 1:35 AM

What do you mean actual id of img tag?


Nov 22, 2009 at 2:27 AM

Hi, for the cropping function I am trying to impliment you need to send in the img tag id, ie. "testImage"

but if you have a control <ext:image id="testImage" ImageURL="./test.gif" runat="server" />, it renders something like <div id="testImage">...<img src="./test.gif"></div> (I'm guessing) and the actual image tag doesnt get an id to it, correct?

I tried doing this but get no img tag named "testImage" on the page, although I do get one with "" as its id:

var images = document.getElementsByTagName("img");
for(var j=0; j<images.length; j++){

Nov 22, 2009 at 3:34 AM

imageClientID = '<%= testImage.ClientID %>'; var imgNode = Ext.query("#"+ imageClientID +" img")[0];

You may use the following code to select the image tag from ext:image control.


Nov 22, 2009 at 4:56 PM