Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flex > Flex 2 & 3

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-19-2006, 04:40 PM   #1
cesperanc@
Registered User
 
Join Date: Jul 2006
Posts: 2
Default mx:DataGrid and Actionscript 3

Hi...
Is it possible add columns to a datagrid using actionscript?
I'm using a datagrid to display fields of a mysql table. Everything works fine, but now I want to control the columns that are displayed because the mysql table is dynamic. For this I want to use actionscript...

I have tryed methods like datagridName.addChild(...) and datagridName.columns.push(...), but it doesn't work. Can someone help me?
cesperanc@ is offline   Reply With Quote
Old 07-20-2006, 10:26 AM   #2
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

i think

Code:
var myColumn:DataGridColumn = new DataGridColumn();
myDataGrid.columns.push( myColumn );
should work?
Tink is offline   Reply With Quote
Old 07-20-2006, 04:17 PM   #3
cesperanc@
Registered User
 
Join Date: Jul 2006
Posts: 2
Default

I have tryed that, but it doesn't work.

If I try this intructions:

Code:
Alert.show(String(myDataGrid.columns.lenght)); //result = 8
var myColumn:DataGridColumn = new DataGridColumn();
Alert.show(String(myDataGrid.columns.push(myColumn ))); //result = 9
Alert.show(String(myDataGrid.columns.lenght)); //result = 8
I can't understand why.
cesperanc@ is offline   Reply With Quote
Old 07-23-2006, 06:06 AM   #4
mantra
Member
 
Join Date: Apr 2006
Location: Sydney, Australia
Posts: 87
Send a message via MSN to mantra
Default

forgive me if this seems like a stupid comment, i notice you have "lenght" instead of what i'm guessing should be length in your code ?

Code:
Alert.show(String(myDataGrid.columns.lenght));
mantra is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.