Results 1 to 4 of 4

Thread: Do Event Listeners take space in DOM?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    34
    Vote Rating
    1
      0  

    Default Answered: Do Event Listeners take space in DOM?

    Hi,

    Case: I have 5 containers inside vbox layout in a parent container. I attach listeners for tap event on each of the 5 child containers. Another way proposed is to add one event listener on the parent container, because apparently it lightens the DOM.

    Questions:

    1. Do Event Listeners take space in DOM?
    2. If I put the event listener on the parent container only, how do I know which child container was clicked?

  2. Event listeners do not take up space in the DOM. They will take up some space in memory. If you can use just 1 listener then you will get a small performance increase over using 5 listeners.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •