0 Replies Latest reply on Sep 7, 2010 1:49 PM by MacBookForever

    Update data using the DataGrid

    MacBookForever

      Hi all,

       

      i would like please to update my data throught the datagrid but i don't know how to do it properly.

      could you pleas help me:

      this the code:

       

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

      <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" height="500" width="100%" layout="absolute" minHeight="500" minWidth="800" horizontalScrollPolicy="off">

      <mx:Script>

      <![CDATA[

      import com.danorlando.model.vo.GestionVO;

      import com.danorlando.controller.UIController;

       

      [Bindable]

      private var _controller:UIController;

       

      public function get controller():UIController { return _controller }

      public function set controller(controller:UIController):void { _controller = controller }

       

       

      ]]>

      </mx:Script>

      <mx:VBox height="85%" width="95%" horizontalCenter="0" verticalCenter="22">

       

      <mx:ToggleButtonBar id="toggle_bar" dataProvider="action_stack" width="100%" />

       

      <mx:ViewStack id="action_stack" height="100%" width="100%">

      <mx:Canvas id="tasks" label="DŽsignations">

      <mx:DataGrid id="tasksGrid" dataProvider="{this._controller.gestionData}" editable="true" height="100%" width="100%">

      <mx:columns>

      <mx:DataGridColumn id="dateTournoi" headerText="Date" dataField="dateTournoi" width="70" editorDataField="selectedItem" textAlign="center"/>

      <mx:DataGridColumn id="villeTournoi" headerText="Ville" dataField="villeTournoi" width="90" editorDataField="selectedItem" textAlign="center"/>

      <mx:DataGridColumn id="nomTournoi" headerText="IntitulŽ du Tournoi" dataField="nomTournoi" width="210" editorDataField="selectedItem" textAlign="center"/>

      <mx:DataGridColumn id="prizeTournoi" headerText="Prize" dataField="prizeTournoi" width="60" editorDataField="selectedItem" textAlign="center"/>

      <mx:DataGridColumn id="categorieTournoi" headerText="CatŽgorie" dataField="categorieTournoi" textAlign="center" width="65" editorDataField="selectedItem"/>

      <mx:DataGridColumn id="surfaceTournoi" headerText="Surface" dataField="surfaceTournoi" textAlign="center" width="70" editorDataField="selectedItem"/>

      </mx:columns>

      </mx:DataGrid>

      </mx:Canvas>

       

      </mx:ViewStack>

       

      </mx:VBox>

      <mx:Label x="19" y="17" text="GESTION DES DESIGNATIONS ET INDEMNITES" fontWeight="normal" fontSize="13"/>

      </mx:Panel>