Jump to content

dalewilson

Members
  • Posts

    8
  • Joined

  • Last visited

dalewilson's Achievements

  1. Thanks to everyone who has contributed to this entry. I have found a solution to this issue. Thanks for your time and energy.
  2. Hi Futurist, So, while I am well versed in Caspio, coding isn't something I do. When you say class/id, do mean inserting a field. For example, cbFormBlock4 would be replaced with [@field:ERM_Color_Ind]. Or is there more to it then that? Many thanks for your thoughts. Dale Wilson
  3. Hi Volomeister, I applied your code, assumed I should change "virtual" to "virtual2" and did not get the expected result. Must be something in my page. I use javascript in other areas to do conditional formatting on rows in a results page, but I have not applied it to a field. I really appreciate your thoughts. Thanks. Dale Wilson
  4. Hi CoopperBackpack, Thanks for the reply. I made the change but did not get the expected result. Still no change of the background color. Still white. So I've seen posts in other areas where fields inserted into javascript needed to be completed using the insert field tool. I'm also wondering if it wouldn't be easier to not have the EMR_Color_Ind field in the DataPages. That field is modified via a trigger. It doesn't need to be on the datapage at all. Also wondering if we should use a regular field for the result instead of a virtual field. I very much appreciate your thoughts and time. I have a strong IT background but on the management side. I understand data relationships but I don't code, which is why I love Caspio because I can do so much of what I want while I maintain a code deficit knowledge base. Your assistance is very much appreciated.
  5. Thanks so much for your assistance. I very much appreciate it. I followed your directions, pasted the code into the footer and made the adjustments you stated. Sadly, it didn't produce the expected results. The background color didn't change. No color appeared. Here's the modified code in the footer: <script> document.addEventListener('DataPageReady', applyColorHandler); function applyColorHandler() { let conditionField = document.querySelector("#EditRecordEMR_Color_Ind]"); let virtualField = document.querySelector("div[data-cb-cell-name*='cbParamVirtual2']").nextElementSibling; if(conditionField.value == 1){ virtualField.style.backgroundColor = '#FF0000'; } else if(conditionField.value == 2){ virtualField.style.backgroundColor = '#FFFF00'; } else if(conditionField.value == 3){ virtualField.style.backgroundColor = '#008000'; } }; </script> Note the virtual field name was changed to "2" as that was the field that was used. I replaced the colors with hex#s. I confirmed that data in the EMR_Color_Ind field was being produced, and it was. Wondering if I failed to do something. Again, really appreciate your effort. Any thoughts would be valued. Thanks. Dale Wilson
  6. I plan on making the "EMR_Color_Ind" a hidden field, and plan for the virtual field to be display only. We can change the virtual field to a text field if need be. Many thanks for your question!
  7. Thanks for the response. I am familiar with the capabilities for changing the color conditionally on rows on a results page. We use it in a number of places on our app. It's great. This problem isn't for a results page. It is to change the background color for a single virtual field on a details page, which requires a different solution. I was hoping someone might have encountered a similar problem and can offer guidance on a solution. Many thanks for your response.
  8. I have a need to change the background color of a virtual field on a details datapage. The field setting the condition is: EMR_Color_Ind. The data in the field will be 1, 2 or 3. I need different colors associated with each setting for the same virtual field. I have not been able to find anything within the community on how to do this. Assistance would be welcome. Many thanks.
×
×
  • Create New...