| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jul 2006
Posts: 2
|
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? |
|
|
|
|
|
#2 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
i think
Code:
var myColumn:DataGridColumn = new DataGridColumn(); myDataGrid.columns.push( myColumn ); |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jul 2006
Posts: 2
|
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 |
|
|
|
|
|
#4 |
|
Member
|
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)); |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|