Hi
I've googled my question, found that LOADS of other people as looking for the same answer... yet none of them are ever answer, but I'll remain hopefull...
Flash CS4, using actionscript 3... how can you populate a datagrid's cell with a combobox?
Can anyone PLEAAAAAASE supply me with the actionscrip for this seemingly impossible task???
Thank you in advance!!! ![]()
There might not be a direct answer to what you are trying to accomplish, but there is a method to do it.
I am assuming that you want to populate a datagrid with values present in a combo box.
They key to doing this is to store the value of the combo box in a way that can be understood by your datagrid.
Both datagrid and comboboxes can read from and store values into the "DataProvider" structure.
So I think you can have a simple for loop to extract the values from a combo box into a data provider and then populate the datagrid with the same.
Hi Karthik, thanx for the answer.
So is there in other words no way to use a CBox as a cell render?
What I actually need is to have an entire table of a datagrid filled with CBoxes to show status of products such as "Approved", "waiting approval" an so on.
So the DG's cell needs to have multiple "data providers" if you think about it... and if you click on any cell, it must give you the other available options.
Make sense?
Hey SaneDevil,
I can understand what you are trying to create. Something like a report generating tool or a data gathering tool.
No there, is no way where the values from a CB can be directly populated into a DG atleast in Flash CS4.
If you are familiar with Flex I think you might have predefined templates for what you are trying to achieve.
Flex is used to create more of such data gathering and data related UI. Flash is used more for animation and other purposes.
So try and have a look into one of the flex templates, for all you might know there might already be a template for what you need.
Hope this post helps you in creating what you need
Cheers!
Hi Karthik, I have another datagrid
Q for you, little bit easier, actually has more to do with printing.
I can only get my app to print the first page but not the ones that follow.
Pleae help!
function printProducts(evt:MouseEvent):void
{
Dg_prods.rowCount = Dg_prods_Rowcount;
Dg_prods.visible = false;
sheets=Dg_prods.numChildren;
printContainer=new Sprite();
addChild(printContainer);
printJob=new PrintJob();
PrintOptions=new PrintJobOptions();
PrintOptions.printAsBitmap=false;
if(printJob.start()){try{addContentSheet();}
catch(error:Error){trace("error");}printJob.send();removeContentAndSpr ite();}else{removeChild(printContainer);}
function addContentSheet():void
{
for (var i:int=0;i < sheets;i++)
{
printContainer.addChild(Dg_prods.getChildAt(0));
printContainer.scaleX = .30;
printContainer.scaleY = .30;
printContainer.width = printJob.pageWidth;
}
printJob.addPage(printContainer,null,PrintOptions);
}
function removeContentAndSprite():void
{
if(Dg_prods_Rowcount > 26) {Dg_prods.height = 560;}
Dg_prods.visible = true;
for (var i:int=0;i < sheets;i++){Dg_prods.addChild(printContainer.getChildAt(0));}removeCh ild(printContainer);
}
}
North America
Europe, Middle East and Africa
Asia Pacific