Skip navigation
Currently Being Moderated

Fill in colour for repeating subforms

Jul 5, 2012 11:24 AM

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.

 

 
Replies
  • Currently Being Moderated
    Jul 5, 2012 3:10 PM   in reply to mmgiath

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points