Using states getting columns in datagrid in runtime
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical” width=”480″ height=”250″ viewSourceURL=”../nwebb_example_code/dg_change_state_add_cols/srcview/index.html”>
<mx:states>
<mx:State name=”SecretState”>
<mx:SetProperty target=”{label1}” name=”text” value=”ADMIN STATE”/>
<mx:SetProperty target=”{salaryCol}” name=”visible” value=”true”/>
<mx:SetProperty target=”{squirrelCol}” name=”visible” value=”true”/>
</mx:State>
</mx:states>
<mx:Script>
<![CDATA[
private function aaa():void
{
currentState = (currentState == 'SecretState') ? '' : 'SecretState';
}
]]>
</mx:Script>
<mx:Label text=”NORMAL STATE” id=”label1″/>
<mx:DataGrid width=”100%” height=”100%”>
<mx:columns>
<mx:DataGridColumn headerText=”Name”/>
<mx:DataGridColumn headerText=”Salary” visible=”false” id=”salaryCol”/>
<mx:DataGridColumn headerText=”Secret Squirrel” visible=”false” id=”squirrelCol”/>
<mx:DataGridColumn headerText=”Age”/>
</mx:columns>
</mx:DataGrid>
<mx:Button label=”toggle states” click=”aaa()”/>
</mx:Application>
No comments yet.
Leave a comment
-
Recent
- Flex for the most need to know 10 things
- Using Action Script Bounce the ball
- Adobe Flex interview questions with answers
- Flex Interview Questions
- Getting image form Xml using repeater
- Tittle window using with an effect
- Mask image album
- Setting style for VScrollBar
- HorizontalList image gallery
- Add many videos in datagrid
- Using states getting columns in datagrid in runtime
- Runtime datagrid
-
Links