Re: [Flashcoders] DataGrid - Content

2005-12-14 Thread Helen Triolo
Put your contents into one array with object elements and use the 
columnNames property to specify only the columns (ie, object properties) 
you want to show.  For example,


mydata = [{company:a, id:3}, {company:b, id:54}, etc];
mygrid.columnNames = [company];

There's a working example here: 
http://flash-creations.com/notes/servercomm_database.php


Helen


Helmut Granda wrote:

Is there anyway to add Data to the Data grid but to keep some of the 
data hidden for a later use?


EXE:
company = [a,b,c,d,e,f,g,h,i]
id = [3,54,97,23,65,87,54,23]

I am displaying the company array into my DataGrid, but I would like 
to keep the ID in relation to the company, I can create an array and 
display the company and its ID, but is there anyway to hide the ID 
but have it ready and linked to the company array?




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] DataGrid - Content

2005-12-14 Thread Helmut Granda

Thanks Robert,

Im glad to hear it can be done, with a for loop I am populating the 
Datagrid:


myDataSet = newArray();
   for (var i = 0; imyResults.length; i++) {
  //this will create 2 columns as we know it
   myDataSet.push({ID:idValue, Name:name, Company:id});
  //this will trow an error
   myDataSet.push({Company:id, idValue});
   }

How would I avoid creating a new column and not getting an error from 
the compiler? Sorry I have been strugling with this project for a 
LONG time and my brain is fried now. :)


Thanks!
...helmut


Robert Chyko wrote:


Sure, when you are setting up the Datagrid, just do not create a column
for the id's.  When you add a row to the Datagrid you can keep id as one
of the values, but it just will not be displayed because there is no
column for it.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Helmut
Granda
Sent: Wednesday, December 14, 2005 1:12 PM
To: Flashcoders mailing list
Subject: [Flashcoders] DataGrid - Content


Is there anyway to add Data to the Data grid but to keep some of the 
data hidden for a later use?


EXE:
company = [a,b,c,d,e,f,g,h,i]
id = [3,54,97,23,65,87,54,23]

I am displaying the company array into my DataGrid, but I would like to 
keep the ID in relation to the company, I can create an array and 
display the company and its ID, but is there anyway to hide the ID but


have it ready and linked to the company array?

Any Pointers greatly appreciated.
Helmut.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] DataGrid - Content

2005-12-14 Thread Helen Triolo

Helmut Granda wrote:


Thanks all for your help on this.

What I can't get my head around and maybe that is why I cant get this 
to work is, how does the DG knows to get the info from certail columns 
only?


I dont see the declaration that the information belongs to the DG.

Using Helen's sample

mydata = [{company:a, id:3}, {company:b, id:54}];
mygrid.columnNames = [company];


one more line (should've included for clarity before):
mygrid.dataProvider = mydata;



How does mygrid knows to get the column company from mydata when my 
data has not yet beein delared to have a relationship with mygrid?




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders