alanhoffman Posted March 30, 2016 Report Share Posted March 30, 2016 Hi all.. I have a weekly calendar data page in my which shows that days for which assets are available.. Is it possible to set the background of the entire box containing all the data conditionally i.e. different colors for different assets e.g. Asset 1: TV Asset 2: DVD Asset 3: PC The weekly calendar shows 1st March 2nd March 3rd March TV Ref: A1233 - TV Ref: A1238 DVD Ref: A1234 DVD Ref: A1236 DVD Ref: A1239 PC Ref: A1235 PC Ref: A1237 - In the weekly calendar, is it possible for each of the assets to have a different colour background for the entire box they are in? I hope the above is clear enough... Many thanks Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted December 24, 2016 Report Share Posted December 24, 2016 I have this code in HTML Block on my report page <div id="visi[@field:ID]"></div> <script> var isi = document.getElementById("visi[@field:ID]"); if('[@field:Name]' == 'A'){ isi.parentNode.parentNode.style.backgroundColor = '#b3e6b3'; }else if('[@field:Name]' == 'B'){ isi.parentNode.parentNode.style.backgroundColor = 'red'; } else if('[@field:Name]' == 'D'){ isi.parentNode.parentNode.style.backgroundColor = 'yellow'; } </script> ID is the unique field in the report and Name is the field I want to check background for based on the value in it Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted December 24, 2016 Report Share Posted December 24, 2016 Here is my sample page https://b3.caspio.com/dp.asp?AppKey=c82f1000e126b5e0409f4a85aae0 Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted December 24, 2016 Report Share Posted December 24, 2016 This will change the whole cell background color <div id="visi[@field:ID]"></div> <script> var isi = document.getElementById("visi[@field:ID]"); if('[@field:Name]' == 'A'){ isi.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = '#b3e6b3'; }else if('[@field:Name]' == 'B'){ isi.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'red'; } else if('[@field:Name]' == 'D'){ isi.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'yellow'; } </script> Quote Link to comment Share on other sites More sharing options...
Question
alanhoffman
Hi all..
I have a weekly calendar data page in my which shows that days for which assets are available..
Is it possible to set the background of the entire box containing all the data conditionally i.e. different colors for different assets
e.g.
Asset 1: TV
Asset 2: DVD
Asset 3: PC
The weekly calendar shows
1st March 2nd March 3rd March
TV Ref: A1233 - TV Ref: A1238
DVD Ref: A1234 DVD Ref: A1236 DVD Ref: A1239
PC Ref: A1235 PC Ref: A1237 -
In the weekly calendar, is it possible for each of the assets to have a different colour background for the entire box they are in?
I hope the above is clear enough...
Many thanks
Link to comment
Share on other sites
3 answers to this question
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.