Inline item renderer that contains multiple controls : DataGrid Renderer « Grid « Flex






Inline item renderer that contains multiple controls

Inline item renderer that contains multiple controls
  


<?xml version="1.0"?>
<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.collections.ArrayCollection;
        [Bindable]
        private var myData:ArrayCollection = new ArrayCollection([
            {Company: 'A', Contact: 'AA',Phone: '123-555-1212', Date: '5/5/05' , FollowUp: true },
            {Company: 'B', Contact: 'BB',Phone: '123-555-3434', Date: '5/6/05' , FollowUp: false}
        ]);
      
    </mx:Script>
    <mx:DataGrid id="myGrid" dataProvider="{myData}" editable="true">
        <mx:columns>
            <mx:DataGridColumn dataField="Company" editable="false" />
            <mx:DataGridColumn dataField="Contact" />
            <mx:DataGridColumn dataField="Phone" />
            <mx:DataGridColumn dataField="Date" />
            <mx:DataGridColumn dataField="FollowUp" width="150"
                headerText="Follow Up?" editorDataField="cbSelected">
                <mx:itemEditor>
                    <mx:Component>
                        <mx:VBox backgroundColor="yellow">
                            <mx:Script>
                                
                                [Bindable]
                                public var cbSelected:Boolean;
                              
                            </mx:Script>
                            <mx:CheckBox id="followUpCB" label="Follow up needed"
                                height="100%" width="100%" selected="{data.FollowUp}"
                                click="cbSelected=followUpCB.selected" />
                        </mx:VBox>
                    </mx:Component>
                </mx:itemEditor>
            </mx:DataGridColumn>
        </mx:columns>
    </mx:DataGrid>
</mx:Application>

   
    
  








Related examples in the same category

1.NumericStepper renderer and editor for DataGridNumericStepper renderer and editor for DataGrid
2.DateField renderer and editor for DataGridDateField renderer and editor for DataGrid
3.CheckBox renderer and editor for DataGridCheckBox renderer and editor for DataGrid
4.Use Image control as item rendererUse Image control as item renderer
5.Use Component as itemRenderer for DataGridUse Component as itemRenderer for DataGrid
6.Use two data fields in one itemRendererUse two data fields in one itemRenderer
7.Inline Item Renderers for DataGridInline Item Renderers for DataGrid
8.Disable DataGrid cell rendererDisable DataGrid cell renderer
9.DataGrid Drop In Image RendererDataGrid Drop In Image Renderer
10.Inline DataGrid RendererInline DataGrid Renderer