Loading ...
Sorry, an error occurred while loading the content.

Re: Event management with IE, strange behavior

Expand Messages
  • valentin_jacquemin
    ... Hi Frank and thanks for your response, Attaching a handler on the table would have been a nice solution. But at that time I cannot refactor the code.
    Message 1 of 3 , Apr 28, 2009
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "ddtechberlin" <ddtech@...> wrote:
      >
      > > I have a very strange issue in IE maybe you will be able to enlighten me.
      > >
      > > I have a classic table with several rows. On each row I have an image on which we can click. The onclick event handler is added this way:
      > >
      > > Event.on(myImage, 'click', function(ev, e) { calltomyfunction(e);}, someIndex);
      > >
      > > My issue is that when I click on the image of the 2nd row for example, the event handler of the 1st row is also called (additionaly to the handler of the 2nd row)!
      > >
      >
      > hmmm... normally events get propagated up the DOM-Tree until handled. You might also stop propagating once You handled it, but as both images should be on the same level, they should not both be affected if You really attach the event to the image and if they are each members of a cell. You might inspect Your DOM-Tree via Firebug. Maybe something got mixed up.
      >
      > Despite that I would bind the event on a higher level and get the target via getTarget(). This way You only need one single eventhandler for the whole table, saving You lots of resources. There are several topics on this here in the forum
      >
      > HTH
      >
      > Frank
      >

      Hi Frank and thanks for your response,

      Attaching a handler on the table would have been a nice solution. But at that time I cannot refactor the code.
      Beside that, I checked the validity of my table structure and it's fine. It works finely on Firefox and the issue is only on IE.

      Anyway, thanks for your response.
    Your message has been successfully submitted and would be delivered to recipients shortly.