2 Replies Latest reply on Jul 12, 2007 7:28 PM by ntsiii

    dynamic datagrid generation

      my setup:
      i have 3 files. the first is the main application file(mxml) that displays a datagrid. the 2nd is an AS file that builds the datagrid (builder pattern). and the 3rd is a datamanager that retrieves my data via webservice that eventually populates the datagrid.

      my situation:
      im trying to dynamically generate a datagrid that is dependant on data i retrieve through a webservice. unfortunately, the result event handler runs asynchronously, and the data is not yet available when my script tries to generate the datagrid.

      i was wondering if there was a way to synchronize this process so i generate the datagrid after the webservice has called the result event, or if there were any other possible alternatives to solve this problem.

        • 1. Re: dynamic datagrid generation
          unix0405 Level 1
          in case anyone was wondering of a solution to this, i made the most of the event driven framework that flex provides and simply extended eventdispatcher within my datamanager class, and called an event back to my main app to let it know when it's ready to generate the datagrid. i'm not sure if there is any, more graceful alternative, but for the time being, it works!! optimization can come after version 1.0 =)
          • 2. Re: dynamic datagrid generation
            ntsiii Level 3
            Invoke the datagrid builder functionality from within the result handler function. This way you are assured the data is available.