0 Replies Latest reply on May 9, 2014 12:38 AM by Udit bhardwaj

    How can i get the value of Datagrid Cell in text box after cell getting updated by {dropdown [<s:itemEditor  ><fx:Component> <s:ComboBoxGridItemEditor> <s:dataProvider><s:ArrayList >]}

    Udit bhardwaj

      Here I am using Webservice to get data in the datagrid now i want to update my last field . while clicking on the Status cell i am getting a dropdown . i want to update the value in the text box on change.
      You see The example i have used in it.

      Resource Used :  http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff8.html

      Adobe Flex 4 * Creating MX inline item renderers and editors

       

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

          xmlns:s="library://ns.adobe.com/flex/spark"

          xmlns:mx="library://ns.adobe.com/flex/mx"

          xmlns:vtrservices="services.vtrservices.*"

          xmlns:vtrservices1="services.vtrservices1.*"

          width="1122" height="632">

       

      <s:layout>

        <s:VerticalLayout/>

        </s:layout>

       

        <fx:Script>

        <![CDATA[

        import mx.controls.Alert;

        import mx.events.FlexEvent;

       

        import spark.components.Grid;

        import spark.events.*;

        import spark.events.GridSelectionEvent;

       

        protected function selectionChangeHandler(event:GridSelectionEvent):void {

        const eventGrid:Grid = event.currentTarget.grid;

        var currentIndx:int = eventGrid.selectedIndex;

        var currentDataItem:Object = eventGrid.selectedItem;

        selIndex.text = String(currentIndx);

        selLName.text = String(currentDataItem.Status);

        }

       

       

        import spark.components.gridClasses.GridColumn;

       

       

        protected function dgTasks_creationCompleteHandler(event:FlexEvent):void

        {

        GetMyTasksNew1Result.token = vtrServices1.GetMyTasksNew1(451);

        }

       

        ]]>

        </fx:Script>

      <fx:Declarations>

        <s:CallResponder id="GetMyTasksNew1Result"/>

        <vtrservices1:VtrServices1 id="vtrServices1"

          fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"

          showBusyCursor="true"/>

        </fx:Declarations>

       

       

       

       

        <s:DataGrid id="dgTasks" width="100%" height="181"

        creationComplete="dgTasks_creationCompleteHandler(event)" editable="true" selectionChange="selectionChangeHandler(event)"

        variableRowHeight="true"  >

        <s:columns>

        <s:ArrayList>

        <s:GridColumn dataField="AssigneeName" headerText="AssigneeName" editable="false"></s:GridColumn>

        <s:GridColumn dataField="Priority" headerText="Priority" editable="false"></s:GridColumn>

        <s:GridColumn dataField="StartTime" headerText="StartTime" editable="false"></s:GridColumn>

        <s:GridColumn dataField="EndTime" headerText="EndTime" editable="false"></s:GridColumn>

        <s:GridColumn dataField="Progress" headerText="Progress" ></s:GridColumn>

        <s:GridColumn dataField="Status" headerText="Status" >

        <s:itemEditor  >

        <fx:Component>

        <s:ComboBoxGridItemEditor>

        <fx:Script>

        <![CDATA[

        ]]>

        </fx:Script>

        <s:dataProvider>

        <s:ArrayList >

        <fx:String>Open</fx:String>

        <fx:String>In Progress</fx:String>

        <fx:String>In Progress On Hold</fx:String>

        <fx:String>In Approval</fx:String>

        <fx:String>Reopened</fx:String>

        <fx:String>Closed</fx:String>

        <fx:String>Deleted</fx:String>

        </s:ArrayList>

        </s:dataProvider>

        </s:ComboBoxGridItemEditor>

        </fx:Component>

        </s:itemEditor>

        </s:GridColumn>

        </s:ArrayList>

        </s:columns>

        <s:AsyncListView list="{GetMyTasksNew1Result.lastResult}"/>

        </s:DataGrid>

       

        <s:Label text="Selected index:"/>

        <s:TextArea id="selIndex" height="50"/>

       

        <s:Label text="Selected Last Name:"/>

        <s:TextArea id="selLName" height="50"/>

       

      </s:WindowedApplication>