1 Reply Latest reply on Jan 19, 2010 4:07 AM by nikos101

    this.includeInLayout function in AdvancedDataGridColumn item renderer question

    nikos101 Level 2

      I can't seem to do this:

       

      <mx:AdvancedDataGridColumn headerText="Received" width="120"  backgroundColor="{CommonFunctions.LIGHT_ORANGE}"  >
                          <mx:itemRenderer >
                              <mx:Component>

       

                                  <mx:HBox horizontalScrollPolicy="off"  >
                                      <mx:Script>
                                          <![CDATA[
                                              override public function set data(value:Object):void
                                              {
                                                  super.data=value;
                                                  if (value != null)
                                                  {
                                                     
                                                      this.visible =  this.data.tradeType != 'V';
                                                      this.includeInLayout =  this.data.tradeType != 'V';

       

       

      the Hox doesn't dissapear when


      this.data.tradeType != 'V';                  

       

      Any ideas friends?

        • 1. Re: this.includeInLayout function in AdvancedDataGridColumn item renderer question
          nikos101 Level 2

          I also tried this but no effect

           

              <mx:AdvancedDataGridColumn backgroundColor="{CommonFunctions.LIGHT_ORANGE}" id="depositPaidDate" dataField="deposit" headerText="Deposit paid" width="70" rendererIsEditor="true">
                              <mx:itemRenderer>
                                  <mx:Component>
                                      <mx:DateField formatString="DD/MM/YYYY" textInputStyleName="white" textAlign="center" visible="{data.tradeType != 'V'}">
                                         
                                   
                                      </mx:DateField>
                                  </mx:Component>
                              </mx:itemRenderer>

           

                          </mx:AdvancedDataGridColumn>

           

          However when wrapped in a Hbox then this works:

          I can't seem to see the difference, maybe this.visible doesn't do anything in the first example

           

          <mx:AdvancedDataGridColumn headerText="Received" width="120"  backgroundColor="{CommonFunctions.LIGHT_ORANGE}"  >
                              <mx:itemRenderer >
                                  <mx:Component>

                                      <mx:HBox horizontalScrollPolicy="off"  >
                                          <mx:Script>
                                              <![CDATA[
                                                  override public function set data(value:Object):void
                                                  {
                                                      super.data=value;
                                                      if (value != null)
                                                      {
                                                         
                                                          ti.visible =  this.data.tradeType != 'V';
                                                          ti.includeInLayout =  this.data.tradeType != 'V';
                                                          cb.visible =  this.data.tradeType != 'V';
                                                          cb.includeInLayout =  this.data.tradeType != 'V';
                                                        
                                                      }
                                                  }
                                              ]]>
                                          </mx:Script>

                                          <mx:ComboBox  id="cb" dropdownStyleName="dropdown" prompt="---">
                                              <mx:change>
                                                  <![CDATA[
                                                  this.data.deposit = cb.selectedLabel;
                                                  this.data.isModified = 1;
                                                  ]]>
                                              </mx:change>

                                          </mx:ComboBox>
                                          <mx:TextInput width="100%" backgroundColor="#ffffff" textAlign="right" borderStyle="inset" restrict=".0-9" maxChars="11" id="ti">

                                       
                                          </mx:TextInput>

                                      </mx:HBox>
                                  </mx:Component>
                              </mx:itemRenderer>

                          </mx:AdvancedDataGridColumn>