Hi,

You can always call a method which would run when result is returned to
client. Look at HTTPService's result attribute...

Anyways, what I am looking for is, how does your array look like when it's
returned from server? Can you give me some idea? It's hard to guess....

my_list.dataValues = [

                                        ????
                           ];


It really helps, if you post a simple test file...

-abdul



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 11:17 AM
To: [email protected]
Subject: Re: [flexcoders] Dymanic data/headers for DataGrid


Yeah, pretty much. Only that some of the indexes may have empty strings.
I need to assign the headers on the fly after the object is returned
from the application server.

Here's the use-case: I click a button, a request is sent to a remote
object. The my_list variable is populated when the result is recieved.
I see the data in the datagrid.

I cannot call an actionscript function to process the result before
displaying because the function statements are executed in an
asynchronous fashion. i.e. in the following function:

public function getData() {

  //logic to get communicate with remote object
  var my_data:Array = my_list.dataValues;
  alert("" + my_data.length);
}

The alert always shows 'undefined' because my_data is not yet
populated based on the previous logic. Thus, I cannot use this method
parse through the results and write the datagrid on the fly.

I hope this is making sense. Thanks.

On 4/22/05, Abdul Qabiz <[EMAIL PROTECTED]> wrote:
> 
> 
> What do you mean by 2d Object array?
> 
> Does your array look like this:
> 
> var dp =        [
>                        {Name:"Dhiren", Age:20},
>                        {Name:"Abdul", Age:23}
>                ];
> 
> 
> -abdul
> 
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
> Sent: Saturday, April 23, 2005 10:34 AM
> To: [email protected]
> Subject: [flexcoders] Dymanic data/headers for DataGrid
> 
> Hi guys,
> 
> I'm sure this question has been asked before, however I can't find a
> suitable answer searching the forum.
> 
> What's the best way to display dynamic data resulting from a remote
> object in a DataGrid. I have no way of knowing the headers or the
> data which will result. I have it as follows now:
> 
> <mx:DataGrid id="dg3" dataProvider="{my_list.dataValues}">
> </mx:DataGrid>
> 
> dataValues is a 2D Object array containing Strings and Doubles.
> 
> This has a few problems:
> 
> 1. The data is displayed in opposite order. i.e. col 0 is displayed
> last and col n is displayed first.
> 
> 2. I cannot display headers.
> 
> Any help would be appreciated. Thanks.
> 
> Dhiren
> 
> Yahoo! Groups Links
> 
> Yahoo! Groups Links
> 
> 
> 
> 
>


 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to