DataGrid Dropin Editor : DataGrid ItemEditor « Grid « Flex






DataGrid Dropin Editor

          
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  backgroundColor="#EEEEEE" creationComplete="initApp()">
  
  <mx:Script>
    
      private function initApp():void
      {
        for (var i:int=0;i < contactAC.length; i++)
        {
          var contact:Object = contactAC.getItemAt(i);
          contact.selected=false;
        }    
      }
  
  </mx:Script>
  
  <mx:Model id="contactData">
    <contacts>
                <row>
                    <contactid>5</contactid>
                    <firstname>A</firstname>
                    <lastname>B</lastname>
                    <streetaddress>Main Street</streetaddress>
                    <city>My City</city>
                    <state>MS</state>
                    <email>a@t.com</email>
                    <phone>000-555-1111</phone>
                    <dob>6/23/2010</dob>
                </row>
     </contacts>

  
  
  </mx:Model>
  <mx:ArrayCollection id="contactAC" source="{contactData.row}"/>
  <mx:DataGrid id="contactGrid" dataProvider="{contactAC}" editable="true" selectable="false">
    <mx:columns>
      <mx:DataGridColumn dataField="selected" itemRenderer="mx.controls.CheckBox"
                         rendererIsEditor="true" editorDataField="selected" headerText="" width="50"/>
      <mx:DataGridColumn dataField="firstname" headerText="First Name" width="100" editable="false"/>
      <mx:DataGridColumn dataField="lastname" headerText="Last Name" width="100" editable="true"/>
    </mx:columns>
  </mx:DataGrid>
  
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use ComboBox as itemEditorUse ComboBox as itemEditor
2.Use an inline item editor, rather than a componentUse an inline item editor, rather than a component
3.Using a DateField or ComboBox control as a drop-in item editorUsing a DateField or ComboBox control as a drop-in item editor
4.Define an event listener for the itemEditEnd event that uses the NumberFormatter class to format cell valueDefine an event listener for the itemEditEnd event that uses the NumberFormatter class to format cell value
5.Use itemEditEnd event to ensure that the user did not enter an empty StringUse itemEditEnd event to ensure that the user did not enter an empty String
6.To prevent cell editing, call the preventDefault() method from within your event listenerTo prevent cell editing, call the preventDefault() method from within your event listener
7.Show an event listener for itemEditEnd event using column index, row index, and value propertiesShow an event listener for itemEditEnd event using column index, row index, and value properties
8.Inline CheckBox Editor With OffsetsInline CheckBox Editor With Offsets
9.Returning data from an item editorReturning data from an item editor
10.Use mx.controls.NumericStepper as DataGridColumn editorUse mx.controls.NumericStepper as DataGridColumn editor
11.use to define an inline item editoruse <mx:Component> to define an inline item editor
12.inline item editor contains a single control that supports the data propertyinline item editor contains a single control that supports the data property
13.Inline DataGrid EditorInline DataGrid Editor
14.Cancel the edit action and maintain edit stateCancel the edit action and maintain edit state
15.Get cell index in cell onEditEnd eventGet cell index in cell onEditEnd event
16.Edited Row and columnEdited Row and column
17.Item Editor Size and PositionItem Editor Size and Position
18.Item Edit Beginning EventItem Edit Beginning Event
19.Item Edit End EventItem Edit End Event