1 Reply Latest reply: Jul 5, 2012 3:10 PM by Niall O'Donovan RSS

    Fill in colour for repeating subforms

    mmgiath Community Member

      I have a repeating subform with max count 5 subforms.

      Is it possible the 4th and 5th repeating rows to have another fill colour?

       

      Here is the script I use for the Add Instance button:

       

      _Item.addInstance();

       

       

      Thank you

      Here is the script I use for the remove Instance button:

       

      if

       

      (_Item.count > 1)

      _Item.removeInstance(this.parent.index);

       

       

       

      Item is a row in a table.

       

        • 1. Re: Fill in colour for repeating subforms
          Niall O'Donovan Community Member

          Hi,

           

          First off, I would not be inclined to name an object/subform "Item". It is very close to a reserved word "item".

           

          Also in the addInstance() method, you should pass a parameter. The default is true.

           

          One route would be to use the layout:ready event of the repeating subform. This is not very efficient, as the layout:ready event fires so often as the user interacts with the form. However it will deal with situations where rows are added and removed.

           

          if (this.parent.index >= 3) {
               this.fillColor = "255,129,129"; 
          }
          

           

          This might give you a start,

           

          Niall