1 Reply Latest reply on Sep 4, 2007 9:56 PM by cmarkiewicz

    addEventListener - creating an async method?

      Hello. Beginner question.

      I have an edit-able DataGrid which is populated by an ArrayCollection. There is an Event Listener on the ArrayCollection. When a user edits a field in the DataGrid, the Event Listener calculates the sum of all of the items in a row - and displays it in a Label field beside the row.

      The issue is performance. Performance isn't great when i go from one DataGrid cell to the next, so I'm trying to speed things up a bit. So one thought is to modify the code so that the transition to the next cell isn't dependent on the calculation completing...

      So how do I do this? (or doesn't this idea make sense?)

      Secondly, anything else i should be looking at to improve performance?

      any assistance is greatly appreciated. thanks for your time.


        • 1. Re: addEventListener - creating an async method?
          cmarkiewicz Level 1
          quick update. i found the main source of the performance issue. the event listener was doing more than just calculating the sum. it was essentially repopulating the grid every time an edit was made. so i removed that event listener at the appropriate time and things are considerably better.

          so there's just the other question - although the more i think about it, i'm not sure it's a legit question. when something fires an event listener, it doesn't wait for the listener to return, right? so it's already async. hmm, so yeah, i guess both questions were bogus.

          my apologies.