2 Replies Latest reply on Feb 21, 2011 9:27 PM by Ananth Flex

    Checkbox change Event...

    Ananth Flex

      My problem is, in my datagrid I'm having a checkbox, if the checkbox is selected means the value in the next consecutive(same row but different column) cell want to get changed.....

       

      is it possible to change the value of a cell in same row as a result of changes in another cell in same row but different column in FLEX 4........

       

       

      please Help me....

       

      Thanks in advance....

        • 1. Re: Checkbox change Event...
          miguel8312 Level 3

          this sounds very possible but again.do you have any sample code?

          Miguel

          • 2. Re: Checkbox change Event...
            Ananth Flex Level 1

            <mx:DataGrid

             

             

             

            id="dg_profile_groups" dataProvider="{first}" width="940" color="#000000"

             

            [#FFFFFF,#A9A9A9]" verticalScrollPolicy="on" itemClick="item_click(event)">

             

             

            <mx:columns>

             

             

            <mx:DataGridColumn id="col1" headerText="Label" width="200" dataField="spk_name"/>

             

             

            <mx:DataGridColumn id="col2" headerText="Key" width="180" dataField="spk_key"/>

             

             

            <mx:DataGridColumn id="col3" headerText="Defaule Value" width="150" dataField="lbl_spk_default_value">

             

             

            <mx:itemRenderer>

             

             

            <fx:Component>

             

             

            <mx:HBox horizontalScrollPolicy="off">

             

             

            <fx:Script>

             

             

            override public function set data(value:Object):void

             

             

            super.data = value;

             

            </fx:Script>

             

             

            <mx:LinkButton id="lkbtn_menu" textDecoration="underline" click="outerDocument.click_Setting(event)"/>

             

             

            </mx:HBox>

             

             

            </fx:Component>

             

             

            </mx:itemRenderer>

             

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn id="col4" headerText="Active" width="45">

             

             

            <mx:itemRenderer>

             

             

            <fx:Component>

             

             

            <mx:HBox>

             

             

            <fx:Script>

             

             

            import mx.collections.ArrayCollection;

             

            override public function set data(value:Object):void

             

             

            super.data = value;

             

            if(data.isActive==1)

             

            true;

             

            else

             

             

            false;

             

            </fx:Script>

             

            <mx:CheckBox id="chkbox_active"/>

             

            </mx:HBox>

             

            </fx:Component>

             

            </mx:itemRenderer>

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn id="col5" headerText="Indexed" width="55">

             

            <mx:itemRenderer>

             

            <fx:Component>

             

            <mx:HBox>

             

             

            <fx:Script>

            <![CDATA[

             

            override public function set data(value:Object):void

            super.data = value;

             

            if(data.isIndexed==1)

             

            true;

             

            else

            false;

             

            </fx:Script>

             

            <mx:CheckBox id="chkbox_active1" click="outerDocument.change_check(event,data)"/>

             

            </mx:HBox>

             

            </fx:Component>

             

            </mx:itemRenderer>

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn id="col6" headerText="Data Type" width="70">

             

            <mx:itemRenderer>

             

            <fx:Component>

             

            <mx:HBox>

             

            <fx:Script>

            <![CDATA[

             

            import mx.collections.ArrayCollection;

             

            Bindable]

             

            override public function set data(value:Object):void

            super.data = value;

             

            if(data.isIndexed==1)

             

            if(data.default_datatype==4)

             

            else if(data.default_datatype==12)

             

            else

            true;

             

            true;

             

            else

            false;

             

            false;

             

            </fx:Script>

             

            <mx:ComboBox id="cbox_check" dataProvider="{outerDocument.cbox_array}" labelField="data"

             

            false" includeInLayout="false" width="70" change="outerDocument.cbox_change_event(event)"/>

             

            </mx:HBox>

             

            </fx:Component>

             

            </mx:itemRenderer>

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn id="col7" headerText="Width" width="100">

             

            <mx:itemRenderer>

             

            <fx:Component>

             

            <mx:HBox>

             

            <fx:Script>

            <![CDATA[

             

            override public function set data(value:Object):void

            super.data = value;

             

            if(data.isIndexed==1)

             

            if(data.default_datatype==4 || data.default_datatype==0)

             

            "";

             

            false;

             

            false;

             

            else if(data.default_datatype==12)

             

            "50";

             

            true;

             

            true;

             

            else

            false;

             

            false;

             

            </fx:Script>

             

            <mx:Label id="lbl_max" text="Max Length"/>

             

            <mx:TextInput id="txt_length" width="30"/>

             

            </mx:HBox>

             

             

            </fx:Component>

             

            </mx:itemRenderer>

             

            </mx:DataGridColumn>

             

             

            </mx:columns>

             

             

            </mx:DataGrid>

             

             

             

            i think this is quite large.... i explain that wat i need nw..... there is a checkbox in the "col5"(this is column id), when the checkbox is checked--> the combox in "col6" and  label , textinput in "col7" in the same row want to get displayed..... And if it is uncheck the checkbox means both want to get dis appeared......

             

            thanks fr u help dude....