0 Replies Latest reply on Sep 16, 2009 6:11 AM by nikos101

    backgroundColor style moves the the cell directly below when the ADG data is changed

    nikos101 Level 2

      I use the following as a renderer in a ADG. However I find that I have to use the  <mx:valueCommit> code to get round a bug where the

      backgroundColor style moves the the cell directly below when the ADG data is changed. Is my solution the only way?

       

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

       

                                      <mx:valueCommit>
                                          <![CDATA[
                                          if(ti.text.search(new RegExp(/.*\..*\./)) != -1){
                                          ti.setStyle('backgroundColor',0xff8b7c);
                                          }
                                          else{
                                          ti.setStyle('backgroundColor',0xffffff);
                                          }
                                          ]]>
                                      </mx:valueCommit>

       

                                      <mx:change>
                                          <![CDATA[
                                          if(ti.text.search(new RegExp(/.*\..*\./)) != -1){
                                          ti.setStyle('backgroundColor',0xff8b7c);
                                          this.data.isModifiedClientSide = 0;
                                          }
                                          else{
                                          ti.setStyle('backgroundColor',0xffffff);
                                          this.data.buyAmount = ti.text.replace(/[,]/g, "");
                                          this.data.isModifiedClientSide = 1;
                                          }
                                          ]]>
                                      </mx:change>
                                  </mx:TextInput>