javascript for conditional formatting of table row

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

10-08-2009

I have a table on one of my Livecycle forms which has rows that need to be conditionally formatted. A calculation involving the values of two of the cells should determine the background color of the cell. I have tried to implement this, but my lack of experience with the Livecycle javascript API is keeping me from being able to get anything out that doesn't just report "Syntax Error" (of course without saying what is invalid...I find Javascript development inside the workbench script window to be extremely frustrating).

This seems like something that would be very common to do in a table, so I was hoping someone could post their script code so I could take a look at it. I should also mention that the rows are repeating rows, and are based on XML data in an attached datasource.

Thanks,

Mike

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Kevin_Cavallo

Avatar

Kevin_Cavallo

Kevin_Cavallo

12-08-2009

Here you go...

Answers (11)

Answers (11)

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

11-08-2009

I'm not sure how to post a sample here, buts its a very simple thing I'm trying to do:

I have a table designed in Livecycle Form Designer.

I want the rows of the table to be, say, red when a specific cell on that row has a certain value.

Otherwise, I want the rows to be white (the default).

Avatar

Avatar

thorsten_rams

Avatar

thorsten_rams

thorsten_rams

09-01-2013

Hi Paul,

could you please post the script of the exit event from your attachment "Purchase Order_add specified row.pdf" here that changes the row color.

I don't see how to extract that from the attached pdf.

Thank you very much.

Regards,

Thorsten

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

12-08-2009

Awesome...thank you. That is easier than I thought it was going to be.

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

12-08-2009

Sorry, I mean the last message to be in reply to you. Can you zip the xdp?

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

12-08-2009

Can you zip it up and attach it?

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

11-08-2009

I know ...I can only put requests in ...I do not control the forum software.

Paul

Avatar

Avatar

Kevin_Cavallo

Avatar

Kevin_Cavallo

Kevin_Cavallo

11-08-2009

Sorry, my attachment was kicked off.  PDF now attached.

Paul, .XDP files are still being rejected...

Avatar

Avatar

Kevin_Cavallo

Avatar

Kevin_Cavallo

Kevin_Cavallo

11-08-2009

Mike, the process is slightly different if you want to deal with repeating rows bound to an XML dataset.  There is an event on the row called "indexChange" that will fire as each row is created and bound to your data.  Inside that event you can check the data and change the color of the row.  See the attached sample form and xml data.

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

11-08-2009

Ok now I get it .....I modifed a sample that I had. The code is on th exit event of the quantity field. If you enter a value greater than 9 then the whole row will change color.

Paul

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

11-08-2009

If you posted a sample of what you are looking for it might help us visulaize what you are doing.

Paul

Avatar

Avatar

MikeTGates

Avatar

MikeTGates

MikeTGates

10-08-2009

A calculation involving the values of two of the cells should determine the background color of the cell

This should read:

A calculation involving the values of two of the cells on a row should determine the background color of each cell in that same row.