0 Replies Latest reply on Mar 1, 2008 8:51 AM by Balaji_Kumar_G

    Item Editor in AdvancedDataGrid

    Balaji_Kumar_G
      I have checkbox again each folder in the datagrid and binded to XMLListCollection. When the value in the field is true, i want that checkbox to be selected. Its not working. Here is the code.

      Thanks in advance.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">
      <mx:Script>
      <![CDATA[
      import mx.collections.HierarchicalData;
      import mx.collections.XMLListCollection;
      ]]>
      </mx:Script>

      <mx:XMLList id="dpHierarchyXML" >
      <Clegs>
      <Cleg name="Cleg1" sel="true">
      <FlightLeg createdDate="10/10/2008" effectiveDate="10/10/2008"
      endDate="10/10/2008" modifiedDate="10/12/2008"
      station="ATL" carrier="Delta"
      flightNo="9W756" acType="122"
      beginDate="10/10/2008" timeRange="10"
      doop="123" region="XYZ"
      year_duration="0.24" moons="0"
      cost="1250"
      />
      </Cleg>
      <Cleg name="Cleg2" sel="true">
      <FlightLeg createdDate="10/10/2008" effectiveDate="10/10/2008"
      endDate="10/10/2008" modifiedDate="10/12/2008"
      station="ATL" carrier="Delta"
      flightNo="9W756" acType="122"
      beginDate="10/10/2008" timeRange="10"
      doop="123" region="XYZ"
      year_duration="0.24" moons="0"
      cost="1250"
      />
      </Cleg>
      </Clegs>
      </mx:XMLList>

      <mx:AdvancedDataGrid
      id="adg"
      dataProvider="{new HierarchicalData(dpHierarchyXML.Cleg)}" rowCount="20"
      width="100%"
      treeColumn="{leg}"
      variableRowHeight="true"
      wordWrap="true" dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" sortExpertMode="true"
      >

      <mx:columns>

      <mx:AdvancedDataGridColumn dataField="@sel"
      headerText=" " width="25" rendererIsEditor="true" editable="true" editorDataField="selected" />
      <mx:AdvancedDataGridColumn dataField="@name" id="leg"
      headerText="cLeg" />
      <mx:AdvancedDataGridColumn dataField="@createdDate"
      headerText="Created Date" />
      <mx:AdvancedDataGridColumn dataField="@effectiveDate"
      headerText="Effective Date" />
      <mx:AdvancedDataGridColumn dataField="@endDate"
      headerText="End Date" />
      <mx:AdvancedDataGridColumn dataField="@modifiedDate"
      headerText="Modified Date" />
      <mx:AdvancedDataGridColumn dataField="@station"
      headerText="Station" />
      <mx:AdvancedDataGridColumn dataField="@carrier"
      headerText="Carrier" />
      <mx:AdvancedDataGridColumn dataField="@flightNo"
      headerText="Flight No" />
      <mx:AdvancedDataGridColumn dataField="@acType"
      headerText="Account Type" />
      <mx:AdvancedDataGridColumn dataField="@beginDate"
      headerText="Begin Date" />
      <mx:AdvancedDataGridColumn dataField="@timeRange"
      headerText="Time Range" />
      <mx:AdvancedDataGridColumn dataField="@doop"
      headerText="DOOP" />
      <mx:AdvancedDataGridColumn dataField="@region"
      headerText="Region" />
      </mx:columns>
      <mx:rendererProviders>
      <mx:AdvancedDataGridRendererProvider columnIndex="0" columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
      </mx:AdvancedDataGridRendererProvider>
      </mx:rendererProviders>

      </mx:AdvancedDataGrid>

      </mx:Application>