4 Replies Latest reply on Feb 24, 2011 3:06 PM by Flex harUI

    Combobox change event...

    Ananth Flex

      My problem is, in my datagrid there is a combobox in 2'nd column 1'st row and if i change the selected index means the value in next cell (that is 3'rd column

      1's row ) want to get changed......

       

      i'm using action script...

       

       

      please Help me....

       

      Thanks in advance....

        • 1. Re: Combobox change event...
          miguel8312 Level 3

          can you post the code or an example im willing to help you but i would need to look at what you are doing.

          Miguel

          • 2. Re: Combobox change event...
            Ananth Flex Level 1

            <mx:DataGrid

             

             

            id="DG_Folder_Curtain" visible="false" width="940"

            dataProvider="

            {getCurtainPatterns}" rowCount="{getCurtainPatterns.length}"

            verticalGridLines="

            false" alternatingItemColors="[#FFFFFF,#A9A9A9]" includeInLayout="false">

             

             

             

            <mx:columns>

             

             

             

            <mx:DataGridColumn id="col1" headerText="Depth" dataField="document_folder_depth" width="90">

             

             

             

            <mx:itemRenderer>

             

             

             

            <fx:Component>

             

             

            <mx:HBox>

             

             

            <fx:Script>

            <![CDATA[

             

             

             

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

            {

             

             

            super.data = value;

            lbl_doc_folder_depth.text=data.document_folder_depth;

            img_doc_folder_depth.toolTip=

            "Delete this Curtain pattern from the System";

            }

             

            ]]>

             

             

            </fx:Script>

             

             

            <mx:Image id="img_doc_folder_depth" source="/IST_Shared/IST_images/IST_icons/Modern/gif/16/normal/trash_16.gif" click="outerDocument.delete_Floder(data)"/>

             

             

            <mx:Label id="lbl_doc_folder_depth"/>

             

             

            </mx:HBox>

             

             

             

            </fx:Component>

             

             

             

            </mx:itemRenderer>

             

             

             

            </mx:DataGridColumn>

             

             

             

            <mx:DataGridColumn headerText="Parent Folder" id="col2" dataField="document_folder_name" width="200">

             

             

             

            <mx:itemRenderer>

             

             

             

            <fx:Component>

             

             

            <mx:HBox>

             

             

             

            <fx:Script>

            <![CDATA[

             

             

             

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

            {

             

             

            super.data = value;

            lbl_doc_folder.text=data.document_folder_name;

            lbl_doc_folder.toolTip=

            "ID: "+data.dfcp_document_folder_id+" PATH: "+data.storage_location_path+"";

            }

             

            ]]>

             

             

            </fx:Script>

             

             

            <mx:Image toolTip="Select Starting Folder." source="/ist_shared/ist_images/ist_icons/Modern/gif/16/normal/edit_16.gif"/>

             

             

            <mx:Label id="lbl_doc_folder"/>

             

             

            </mx:HBox>

             

             

             

            </fx:Component>

             

             

             

            </mx:itemRenderer>

             

             

             

            </mx:DataGridColumn>

             

             

             

            <mx:DataGridColumn headerText="Pattern Type" id="col3" width="120">

             

             

             

            <mx:itemRenderer>

             

             

             

            <fx:Component>

             

             

            <mx:HBox>

             

             

             

            <fx:Script>

            <![CDATA[

             

             

            import mx.collections.ArrayCollection;

             

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

            {

             

             

            super.data = value;

             

            if(data.dfcp_name_pattern_type=="EQ")

            {

            cbox_pattern_type.selectedIndex=1;

            }

             

            else if(data.dfcp_name_pattern_type=="B")

            {

            cbox_pattern_type.selectedIndex=2;

            }

             

            else if(data.dfcp_name_pattern_type=="E")

            {

            cbox_pattern_type.selectedIndex=3;

            }

             

            else

            {

            cbox_pattern_type.selectedIndex=0;

            }

            }

             

            ]]>

             

             

             

            </fx:Script>

             

             

            <mx:ComboBox id="cbox_pattern_type" dataProvider="{outerDocument.source_pattern_type}" labelField="data" change="outerDocument.change_Pattern_type(event,data)"/>

             

             

            </mx:HBox>

             

             

            </fx:Component>

             

             

             

            </mx:itemRenderer>

             

             

             

            </mx:DataGridColumn>

             

             

             

            <mx:DataGridColumn headerText="Folder Pattern" id="col4" dataField="dfcp_name_pattern" width="300">

             

             

            <mx:itemRenderer>

             

             

            <fx:Component>

             

            <mx:HBox>

             

            <fx:Script>

            <![CDATA[

             

            import mx.utils.StringUtil;

             

            public var before_change:String;

             

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

            {

             

            super.data = value;

            lbl_dnp.text=data.dfcp_name_pattern;

            lbl_dnp.toolTip=

            "To Curtain the Parent Folder use the Keyword SELF.";

             

            }

             

            public function on_click():void

            {

            before_change=lbl_dnp.text;

            lbl_dnp.includeInLayout=

            false;

            lbl_dnp.visible=

            false;

            txt_pattern.includeInLayout=

            true;

            txt_pattern.visible=

            true;

            txt_pattern.text=lbl_dnp.text;

            txt_pattern.setFocus();

            }

             

            public function txt_focuse_out(e:FocusEvent,data:Object):void

            {

             

            var temp:TextInput=TextInput(e.currentTarget);

             

            var after_change:String=temp.text;

            e.currentTarget.visible=

            false;

            lbl_dnp.text=StringUtil.trim(temp.text);

            lbl_dnp.includeInLayout=

            true;

            lbl_dnp.visible=

            true;

             

            if(after_change!=before_change)

            {

             

            //outerDocument.flag=1;

            outerDocument.onclick_Folder_patern(e,data,after_change)

            lbl_dnp.text=after_change;

            }

             

            else

            {

             

            }

            }

            ]]>

             

             

            </fx:Script>

             

            <mx:Image source="/ist_shared/ist_images/ist_icons/Modern/gif/16/normal/edit_16.gif" toolTip="Edit The Folder Pattern." click="on_click()"/>

             

            <mx:Label id="lbl_dnp" visible="true" includeInLayout="true"/>

             

            <s:TextInput id="txt_pattern" visible="false" includeInLayout="false" focusOut="txt_focuse_out(event,data)"/>

             

            </mx:HBox>

             

            </fx:Component>

             

             

            </mx:itemRenderer>

             

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn headerText="Right Level" id="col5" width="120">

             

             

            <mx:itemRenderer>

             

             

            <fx:Component>

             

            <mx:HBox>

             

             

            <fx:Script>

            <![CDATA[

             

            import mx.collections.ArrayCollection;

             

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

            {

             

            super.data = value;

             

            if(data.dfcp_sec_rights_level==1)

            {

            cbox_right_level.selectedIndex=2;

            }

             

            else if(data.dfcp_sec_rights_level==10)

            {

            cbox_right_level.selectedIndex=3;

            }

             

            else if(data.dfcp_sec_rights_level==50)

            {

            cbox_right_level.selectedIndex=4;

            }

             

            else if(data.dfcp_sec_rights_level==0)

            {

            cbox_right_level.selectedIndex=1;

            }

             

            else

            {

            cbox_right_level.selectedIndex=0;

            }

             

             

            //var selected_index:int=cbox_level.selectedIndex;

            }

             

            ]]>

             

             

            </fx:Script>

             

            <mx:ComboBox id="cbox_right_level" dataProvider="{data.source_pattern_type}" labelField="sec_rights_level" change="outerDocument.onchange_cbox_level(event,data)"/>

             

            </mx:HBox>

             

            </fx:Component>

             

             

            </mx:itemRenderer>

             

             

            </mx:DataGridColumn>

             

             

            <mx:DataGridColumn headerText="Effective" id="col6" dataField="dfcp_sec_rights_level" width="150">

             

             

            <mx:itemRenderer>

             

             

            <fx:Component>

             

            <mx:HBox>

             

            <fx:Script>

            <![CDATA[

             

             

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

            {

             

            super.data = value;

             

            if(data.df_sec_rights_level <= data.dfcp_sec_rights_level)

            {

            lbl_sec_right_level.text=data.dfcp_sec_rights_level;

            }

             

            else

            {

            lbl_sec_right_level.text=data.df_sec_rights_level;

            }

            lbl_sec_right_level.toolTip=

            "The Effective User Right Level required.";

            }

             

            ]]>

             

             

            </fx:Script>

             

            <mx:Label id="lbl_sec_right_level"/>

             

            <mx:HBox paddingLeft="90">

             

            <mx:Image source="/ist_shared/ist_images/ist_icons/Modern/gif/16/normal/filesys_refresh_16.gif" toolTip="Refresh the Folder Curtains." click="outerDocument.onclick_Refresh(data)"/>

             

            </mx:HBox>

             

             

            </mx:HBox>

             

            </fx:Component>

             

             

            </mx:itemRenderer>

             

             

            </mx:DataGridColumn>

             

             

            </mx:columns>

             

             

            </mx:DataGrid>

             

             

             

             

             

             

             

            Hi... Here i explain u.... For my datagrid i'm getting data from remote object... note that in "col5"(column id) there is a combobox, if the selected index of combobox get changed means, the text for label in "col6"(column id) in the same row (but next column) wann to be"?".... i dont know how to do this... help me buddy......

             

             

             

             

             

             

             

             

             

             

             

            • 3. Re: Combobox change event...
              Ananth Flex Level 1

              hi all.... plese help tp solve the above probl

              me please.....

               

              my problem is...

              in my datagrid there is a combobox in 2'nd column 1'st row and if i change the selected index means the value in next cell (that is 3'rd column

              1's row ) want to get changed......

               

              i'm using action script...

              • 4. Re: Combobox change event...
                Flex harUI Adobe Employee

                When the combobox changes, you should update the dataprovider item

                immediately.  The other column should be bound to the appropriate field in

                the dataprovider item.