Skip to Content
0

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

May 15, 2017 at 07:18 AM

155

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Prajesh Desai May 15, 2017 at 10:56 AM
0

to change whole row, try below,

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

Hope this helps.

Show 1 Share
10 |10000 characters needed characters left 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";
 }
0
avatar image
Former Member May 18, 2017 at 09:34 AM
0

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";

Share
10 |10000 characters needed characters left characters exceeded