Adobe Dreamweaver Forums



Last 10 THreads :         flash loader reappears after movie plays (Last Post : lyshamo - Replies : 3 - Views : 4 )           »          cfimage error (Last Post : -==cfSearching==- - Replies : 1 - Views : 2 )           »          How to turn IMAGE into MOVIECLIP??? (Last Post : Snufferson - Replies : 7 - Views : 8 )           »          Embed files in a projector (Last Post : ytlevine - Replies : 0 - Views : 1 )           »          ColdFusion = "old technology" (Last Post : Ian Skinner - Replies : 7 - Views : 8 )           »          Load dynamic text into an embeded swf (Last Post : mikeyjray - Replies : 4 - Views : 9 )           »          Log email text (Last Post : Torgom - Replies : 0 - Views : 1 )           »          Properties > Flex Build Path (Last Post : kevxross - Replies : 0 - Views : 1 )           »          Can Anyone Help With Sub Menus (Last Post : Murray *ACE* - Replies : 8 - Views : 9 )           »          transferring DW license from crashed computer (Last Post : Sonjay - Replies : 1 - Views : 7 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 12-03-2008, 05:02 PM
nickname118
 
Posts: n/a
Diggs:
Default datagrid in a datagrid

Can someone help me in figuring out how to render a datagrid inside a datagrid?

I have tried to create two datagrids datagrid1, and datagrid2. I set their
dataproviders and columns.
So they are functional as separate datagrids.

Now I simply want another datagrid that has two columns, each of which contain
one of the smaller datagrids.
I set the dataprovider to an arraycollection containing the two datagrids,
i.e. dataprovider[0] = {grid1: datagrid1, grid2: datagrid2};

I set the data fields for the columns to grid1 and grid2 respectively.
And I set the itemrenderer = new ClassFactory(DataGrid);

Now, none of the data displays from the original datagrids. It just shows two
columns with empty boxes.
What have I done incorrectly, and what must I do to get this to work properly?
I have seen a couple examples of this working before, but the code for these
relies too much on mxml and static xml data for me to figure out how to
translate it. I am trying to do this in just actionscript and I don't know
where or what my data will be at run time, but probably will end up as an
arraycollection of some sort.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-03-2008, 06:14 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: datagrid in a datagrid


"nickname118" <webforumsuser@macromedia.com> wrote in message
news:gh6doc$eig$1@forums.macromedia.com...
> Can someone help me in figuring out how to render a datagrid inside a
> datagrid?
>
> I have tried to create two datagrids datagrid1, and datagrid2. I set their
> dataproviders and columns.
> So they are functional as separate datagrids.
>
> Now I simply want another datagrid that has two columns, each of which
> contain
> one of the smaller datagrids.
> I set the dataprovider to an arraycollection containing the two datagrids,
> i.e. dataprovider[0] = {grid1: datagrid1, grid2: datagrid2};
>
> I set the data fields for the columns to grid1 and grid2 respectively.
> And I set the itemrenderer = new ClassFactory(DataGrid);
>
> Now, none of the data displays from the original datagrids. It just shows
> two
> columns with empty boxes.
> What have I done incorrectly, and what must I do to get this to work
> properly?
> I have seen a couple examples of this working before, but the code for
> these
> relies too much on mxml and static xml data for me to figure out how to
> translate it. I am trying to do this in just actionscript and I don't know
> where or what my data will be at run time, but probably will end up as an
> arraycollection of some sort.


How are you setting the dataproviders on the inner datagrids, and is there
information at that level of the structure to feed them?


Reply With Quote
  #3 (permalink)  
Old 12-03-2008, 06:53 PM
nickname118
 
Posts: n/a
Diggs:
Default Re: datagrid in a datagrid

OK, I have two dataproviders for the inner grids. Just two array collections, I
don't need to go into what the data is. Let's say they are just strings or
numbers for now.

var dataprovider1:ArrayCollection = new ArrayCollection(
[{ data: 1, data2: 2, etc..}]);
var dataprovider2:ArrayCollection = new ArrayCollection(
[{ data: 3, data2: 4, etc..}]);

var grid1ataGrid = new DataGrid();
grid1.dataProvider = dataprovider1;

var grid2ataGrid = new DataGrid();
grid2.dataProvider = dataprovider2;


var outerDataProvider:ArrayCollection = new ArrayCollection(
[{grid1: grid1, grid2:grid2}]);

var outterGridataGrid = new DataGrid();
outterGrid.dataProvider = outerDataProvider;


I'm not sure what you mean by "information at that level of the structure to
feed them". I have assigned the data providers, and they have data in them...
So what do you mean?

I left out the code, but for the collumns I reference the appropriate names
from each arraycollection in the dataproviders. And for the outterGrid I assign
an itemrenderer of type DataGrid. I do this specifically with a ClassFactory,
because the itemrenderer field is an IFactory object.

Reply With Quote


  #4 (permalink)  
Old 12-03-2008, 07:53 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: datagrid in a datagrid


"nickname118" <webforumsuser@macromedia.com> wrote in message
news:gh6k5p$m8o$1@forums.macromedia.com...
> OK, I have two dataproviders for the inner grids. Just two array
> collections, I
> don't need to go into what the data is. Let's say they are just strings or
> numbers for now.
>
> var dataprovider1:ArrayCollection = new ArrayCollection(
> [{ data: 1, data2: 2, etc..}]);
> var dataprovider2:ArrayCollection = new ArrayCollection(
> [{ data: 3, data2: 4, etc..}]);
>
> var grid1ataGrid = new DataGrid();
> grid1.dataProvider = dataprovider1;
>
> var grid2ataGrid = new DataGrid();
> grid2.dataProvider = dataprovider2;
>
>
> var outerDataProvider:ArrayCollection = new ArrayCollection(
> [{grid1: grid1, grid2:grid2}]);
>
> var outterGridataGrid = new DataGrid();
> outterGrid.dataProvider = outerDataProvider;
>
>
> I'm not sure what you mean by "information at that level of the structure
> to
> feed them". I have assigned the data providers, and they have data in
> them...
> So what do you mean?


Typically, an itemrenderer is, well, rendering an item. So if you have a
need for a datagrid as an itemRenderer, that item should contain data that
could serve as a dataProvider itself. This would be the case if, for
instance, you had a nested ArrayCollection (HierarchicalData), or if you had
hierarchical XML.

> I left out the code, but for the collumns I reference the appropriate
> names
> from each arraycollection in the dataproviders.


That doesn't even make any sense. To make thiswork, you're almost certainly
going to have to make a custom itemRenderer. I don't think there's any way
to specify a dataProvider for something _inside_ an itemRenderer from the
column definition.

> And for the outterGrid I assign
> an itemrenderer of type DataGrid. I do this specifically with a
> ClassFactory,
> because the itemrenderer field is an IFactory object.


I understand all the words you used, but they don't come together into any
sort of sensible whole.



Reply With Quote
  #5 (permalink)  
Old 12-04-2008, 05:02 PM
nickname118
 
Posts: n/a
Diggs:
Default Re: datagrid in a datagrid

I'm sorry, but I think you just bypassed my question and the code I posted.

I am talking as an object-programmer. I am not typically a Flex programmer,
but I am forced to do things in Flex due to a team design decision. If you
don't understand what I am talking about when referring to my code, that would
probably be the source of the confusion.

Anyway. I don't know the underworkings of a DataGrid class and how it uses
DataGridColumns. But I had tried to instantiate everything through actionscript
and assign values that way.

I defined some DataGridColumns in this way.

var column1ataGridColumn = new DataGridColumn();
column1.dataField = "grid1";
column1.itemrenderer = new ClassFactory(DataGrid);

var column2ataGridColumn = new DataGridColumn();
column2.dataField = "grid2";
column2.itemrenderer = new ClassFactory(DataGrid);

This works. The only issue is that no data or any information whatsoever from
the DataGrid oject contained within the outterGrid's dataProvider is getting
loaded. What I described is precisely a nested ArrayCollection.

Like I said the outterGrid has arrayCollection with objects [{grid1: grid1,
grid2: grid2}, {grid1: someotherGrid, grid2: someotherGrid2}]

Then there are separate dataProviders within the grid1 and grid2 DataGrids. I
don't understand why the outterGrid ever needs to see or know about the
dataProviders contained in the inner grids. If the innerGrid knows how to
render itself outside of the outterGrid, then why can it not render within the
outterGrid? Clearly the outterGrid is not calling some generic renderering
function on its inner components, and it is causing me much frustration.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:27 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk