Skip to Content
avatar image
Former Member

Question: How to change dynamically the background color of a table row in adobe forms

Hello,

currently I try to change dynamically the background color of my table in my Adobe form and need some help regarding the javascript.

My table looks like the following example:

Columns:


KUNNR BELNR XBLNR BLDAT SGTEXT WEARS WRBTR


My table is build up with a total row, that means, if the total row is printed the column BELNR contains e.g. the value: "Summe" .

I have managed it already in javascript to change the background color of the column BELNR if there is a value like "Summe".

Nevertheless I would like to change the whole row to another background color.


How is this possible?

My current javascript looks like this and is placed in:

data.Subform.Tabelle1.Zeile1.BELNR::initialize - (JavaScript, Client)


if (this.resolveNode("$").rawValue == "Summe:" )
{
// this.fontColor = "0,0,0";
this.fillColor = "255,255,130";
this.font.weight = "bold";

}

Thank you for every hint.

Best Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 15, 2017 at 10:56 AM

    to change whole row, try below,

    data.Subform.Tabelle1.Zeile1.BELNR::initialize - (JavaScript, Client)
    this.parent.fillColor = "150,130,33";

    Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Prajesh,

      thank you for your helpfull answer.

      I have implemented your code in 'ready::form' and it works fine now.

       data.Subform.Tabelle1.Zeile1.BELNR::ready:form - (JavaScript, client)
       if (this.resolveNode("$").rawValue == "Saldo:" )
       {
           this.font.weight = "bold";
           this.parent.fillColor = "255,255,130";
       }
      
  • avatar image
    Former Member
    May 18, 2017 at 09:34 AM

    Hello,


    i have got another question. I change the color with the above mentioned code.

    Now I want to change also the font style to "bold".

    How is this possible?

    Thank you.

    EDIT: Problem is solved.

    Following Syntax works:

    this.parent.WRBTR.font.weight = "bold";

    Add comment
    10|10000 characters needed characters exceeded