|
Home > Archive > Macromedia Flash Server > April 2005 > OT: XML and datagrid
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
OT: XML and datagrid
|
|
| Simon Lord 2005-04-07, 5:51 pm |
| I asked this earlier on Flashcoders and was depressed when I realized
that in order to get the data from the dataGrid *back* into an xml
object all neatly formatted that I would have to create a function to
break down the nodes and essentially build it back up. I'm ok with
that, but can someone explain the following:
Using the TREE component you can get the XML back using this:
var tree:mx.controls.Tree = nodes_tree;
newnotes.text = tree.dataProvider;
.... and this works just fine. I get all the XML back, and stuff I
added to the tree as well. But when I try the following on a dataGrid
component:
var myXML:mx.controls.DataGrid = mydatagrid;
newnotes.text = myXML.dataProvider;
.... all I get is object object object object object object object and
so on. I'm baffled because I can feed the tree and datagrid right from
the same xml source file, but only one of these components can toss the
xml back at me? Does that make any sense?
Sincerely,
Simon
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| Fernando Flórez 2005-04-07, 5:51 pm |
| That's because the Tree component dataprovider uses the xml internally
and the datagrid translates it into an array with objects (that's why
you get object, object...).
Smth you can do is strong type a property on the datagrid component
and place there your xml tree just for reference, but if you need that
tree to change dynamically depending on what you do (addItem,
removeItemAt, replaceItemAt, etc.) then you will need to recreate the
xml tree with the array dataprovider at the end.
Fernando
On Wed, 02 Mar 2005 02:37:55 -0500, Simon Lord <slord-1+jUDDTtyItWk0Htik3J/w@public.gmane.org> wrote:
> I asked this earlier on Flashcoders and was depressed when I realized
> that in order to get the data from the dataGrid *back* into an xml
> object all neatly formatted that I would have to create a function to
> break down the nodes and essentially build it back up. I'm ok with
> that, but can someone explain the following:
>
> Using the TREE component you can get the XML back using this:
>
> var tree:mx.controls.Tree = nodes_tree;
> newnotes.text = tree.dataProvider;
>
> ... and this works just fine. I get all the XML back, and stuff I
> added to the tree as well. But when I try the following on a dataGrid
> component:
>
> var myXML:mx.controls.DataGrid = mydatagrid;
> newnotes.text = myXML.dataProvider;
>
> ... all I get is object object object object object object object and
> so on. I'm baffled because I can feed the tree and datagrid right from
> the same xml source file, but only one of these components can toss the
> xml back at me? Does that make any sense?
>
> Sincerely,
> Simon
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|
|
|
|
|