I have an array collection that looks like
public var dp:ArrayCollection = new ArrayCollection(
[{type: 'Pen', price: '10' , label: "Stock Name" }
,{type: 'Sock' , price: '20' , label: "Stock Name" }
]);
I want to display that data in a datagrid but I do not want
to display the 'label' column instead I want the value of the label
column to be the
heading for the type column .. eg: I want my datagrid to look like ..
Stock Name Price
Pen 10
Sock 20
Ok I hear you say , boy this dude is a real noob :) , why doesnt he
just use mx:Column
. Well I'm a noob but its not that simple :) .. The data I need to
'display' could have more 'columns' .. eg the data could be ..
[{type: 'Pen', price: '10' , qty: '5' , label: "Stock
Name" }
,{type: 'Sock' , price: '20' , qty '9', label:
"Stock Name" }
]);
The only thing I do know is that the data will contain a label and a
type where
the label column isnt to be displayed but will be the 'heading' for the
type column ..
The rest of the data then needs to be in its own column ..
eg:
Stock Name price qty
Pen 10 5
Sock 20 9
I was wondering if there was a way I could use ActionScript to Add the
columns I want .. by looping the the ArrayCollection and generating the
DataGrid via actionScript ..
or is there another way ? :)
Thanks for any help ..