1 Reply Latest reply on Aug 10, 2011 10:51 PM by Vibhuti Gosavi(InfoCepts)

    how make a button enable property "true" while i am clicking a row from datagrid in mxml flex4 app

    Venkatesan Balasubramanian Level 1

      hi friends,

       

      i am new to flex, i am doing flex4 web application with mxml tags.

       

      i have struck in this place,please give some idea.

       

      i have one data grid with 5 rows and 4columns,and also i am having one button (property enable is false).

       

       

      while i am click a particular row from datagrid that time the button property enbale should be change to true.

       

      where i have to write code.

       

      any suggession or snippet code,

       

      Thanks in advance.

       

      B.venkatesan.

        • 1. Re: how make a button enable property "true" while i am clicking a row from datagrid in mxml flex4 app
          Vibhuti Gosavi(InfoCepts) Level 3

          Hi,

           

          You can take help of following code :

           

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

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

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

             xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

          <fx:Declarations>

          <!-- Place non-visual elements (e.g., services, value objects) here -->

          </fx:Declarations>

           

          <fx:Script>

          <![CDATA[

          import mx.collections.ArrayCollection;

          [Bindable]

          public var Arr:ArrayCollection = new ArrayCollection([{a:"AAA",b:"BBB"} , {a:"111" , b:"222"}]);

          public function enable():void{

          Btn.enabled=true;

          }

          ]]>

          </fx:Script>

          <mx:DataGrid x="91" y="36" dataProvider="{Arr}" click="enable()">

          <mx:columns>

          <mx:DataGridColumn headerText="Column 1" dataField="a"/>

          <mx:DataGridColumn headerText="Column 2" dataField="b"/>

           

          </mx:columns>

          </mx:DataGrid>

          <s:Button x="210" y="237" id="Btn" label="Button" enabled="false"/>

          </s:Application>

          Thanks and Regards,
          ------------------------------------------------------------------------------------------ --
          Vibhuti Gosavi | vgosavi@infocepts.com | www.infocepts.com
          ------------------------------------------------------------------------------------------ --