RoberthSS Posted June 18, 2018 Report Share Posted June 18, 2018 I have a Tabular Data Report that contains several information, and a column with status. This Status is a List String that the user can also use to order the rows, or even as a filter in the search form. The point is that i tried to apply some conditionally changes using the tips in the caspio website and also using some content here of the forum, but with no success, and i'm almost certainly that is because i don't know javascript well. So, in the list string of status have some options to be selected, but i would like that if i select one of the options and update the row, the color of the row change based on the option i have selected. In example: If i change the status of "Day 1: Entry of Order" to "Day 4: Order Delay", the row that was with a normal backgroud before the update, with the new status selected, turns on red. I expect that my example could be clear enough to compreend the problem, and if need, i can send the link via message box for you to have a better idea of the problem. MikeN 1 Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 20, 2018 Report Share Posted June 20, 2018 List string can have more than one option selected , so you can use the code below in an HTML Block that is added to the end of element list in your report page <a id="visi[@field:Id#]"> <script> var isi = document.getElementById("visi[@field:Id#]"); var str='[@field:ListString]'; if(str.includes("Day 1: Entry of Order")){ isi.parentNode.parentNode.style.backgroundColor = 'red'; } else if(str.includes("Day 4: Order Delay")){ isi.parentNode.parentNode.style.backgroundColor = 'yellow'; } </script></a> Replace [@field:Id#] and [@field:ListString] and select them from picker. ID should be the unique field in your table. Quote Link to comment Share on other sites More sharing options...
RoberthSS Posted June 21, 2018 Author Report Share Posted June 21, 2018 Thank you MayMusic, it's worked great! Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 27, 2018 Report Share Posted June 27, 2018 You are welcome Quote Link to comment Share on other sites More sharing options...
Medron Posted August 28, 2018 Report Share Posted August 28, 2018 Can you use a text field with this js code? Quote Link to comment Share on other sites More sharing options...
PotatoMato Posted yesterday at 07:59 AM Report Share Posted yesterday at 07:59 AM Hi, @Medron, yes. Here's a how-to article: https://howto.caspio.com/tech-tips-and-articles/customize-background-and-font-colors-in-report-datapage/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.