0 Replies Latest reply on Feb 21, 2011 9:08 PM by Ananth Flex

    Here is the code....

    Ananth Flex Level 1

      <mx:DataGrid

       

       

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

      alternatingItemColors="

      [#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>

      <![CDATA[

       

       

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

      {

       

       

      super.data = value;

       

      var str_search:String="#";

       

      var str_app:String=data.app_spk_default_value;

       

      var str_spk:String=data.spk_default_value;

       

      var title_spk_default_value:String;

       

      var lbl_spk_default_value:String;

       

       

      if(outerDocument.Get_all_keys.length>0)

      {

       

      if(str_app!=null && str_app!="")

      {

       

      if(str_app.search(str_search)>=0)

      {

       

      try

      {

      lbl_spk_defaultvalue=

       

      "[1A]"+data.app_spk_default_value;

       

      }

       

      catch(e:Error)

      {

      lbl_spk_defaultvalue=

      "Error";

      }

      }

       

      else

       

      {

       

       

       

      try

      {

      lbl_spk_defaultvalue=

       

      "[2A]"+data.app_spk_default_value;

      }

       

      catch(e:Error)

      {

      lbl_spk_defaultvalue=

      "Error";

      }

       

      }

       

      title_spk_defaultvalue=data.app_spk_default_value;

       

      }

       

      else

      {

       

       

       

      if(str_spk!=null)

      {

       

       

      if(str_spk.search(str_search)>=0)

      {

       

      try

      {

      lbl_spk_defaultvalue=

       

      "[1]"+data.spk_default_value;

      }

       

      catch(e:Error)

      {

      lbl_spk_defaultvalue=

      "Error";

      }

       

       

      }

       

       

      else

      {

       

       

       

      try

      {

      lbl_spk_defaultvalue=

       

      "[2]"+data.spk_default_value;

      }

       

      catch(e:Error)

      {

      lbl_spk_defaultvalue=

      "Error";

      }

       

      }

      title_spk_defaultvalue=data.spk_default_value;

      }

       

      }

       

      }

       

      if(outerDocument.My_mpf_level>=200)

      {

       

      var title_x:String=title_spk_default_value;

      }

       

      else

      {

       

       

      var title_x:String="";

      }

       

       

      if(lbl_spk_defaultvalue==null)

      {

      lbl_spk_defaultvalue=

      "N/A";

      }

      lkbtn_menu.label=lbl_spk_default_value;

      lkbtn_menu.toolTip=

      "[1]Variable [2]Static [nA]App Specific "+title_x+"";

      }

       

      ]]>

       

      </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>

      <![CDATA[

       

       

      import mx.collections.ArrayCollection;

       

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

      {

       

       

      super.data = value;

       

      if(data.isActive==1)

      {

      chkbox_active.selected=

      true;

      }

       

      else

      {

      chkbox_active.selected=

       

      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;

      outerDocument.chk_active=chkbox_active1;

       

      if(data.isIndexed==1)

      {

      chkbox_active1.selected=

      true;

      }

       

      else

      {

      chkbox_active1.selected=

      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

      {

       

       

      outerDocument.cbox_change=cbox_check;

       

      super.data = value;

       

       

      if(data.isIndexed==1)

      {

       

       

      if(data.default_datatype==4)

      {

      cbox_check.selectedIndex=1;

      }

       

      else if(data.default_datatype==12)

      {

      cbox_check.selectedIndex=2;

      }

       

      else

      {

      cbox_check.selectedIndex=0;

      }

       

      cbox_check.visible=

      true;

      cbox_check.includeInLayout=

      true;

      }

       

      else

      {

      cbox_check.includeInLayout=

      false;

      cbox_check.visible=

      false;

      }

       

      }

      ]]>

       

      </fx:Script>

       

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

      visible="

      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

      {

      outerDocument.txt_max=txt_length;

      outerDocument.lbl_length=lbl_max;

       

      super.data = value;

       

      if(data.isIndexed==1)

      {

       

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

      {

      txt_length.text=

      "";

      lbl_max.visible=

      false;

      txt_length.visible=

      false;

      }

       

      else if(data.default_datatype==12)

      {

      txt_length.text=

      "50";

      txt_length.visible=

      true;

      lbl_max.visible=

      true;

      }

       

      }

       

      else

      {

      lbl_max.visible=

      false;

      txt_length.visible=

      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....