Jump to content
  • 0

Separate blocks for each record


imJihyo

Question

Hi guys! I have a calendar datapage that shows schedules of clients/patients. Each day can accommodate more than 1 patient, but it can get a little confusing to see so much info in a day. Does anyone know how I can, like, put boxes or maybe anything that will separate the records from each other? 

Here's my test datapage:https://c7afw131.caspio.com/dp/a63390000bb5b1a6ed0344c1a94f

Any help or reference would be highly appreciated! thanks!

 

image.thumb.png.70868cb11d23a690afb6ef88dd159779.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi there again @imJihyo!

Would this do? I added a background color and margin too to make it look more separatedimage.thumb.png.cfbe4e196933cadf96ff3b6ad0406fcf.png

If this is what you want, you can add this style to your datapage header

 

<style>

dl.cbResultSetPanelDataContainer{
    background-color: beige !important;
    margin: 10px;
}

</style>

hope this helps!

 

- LOEY

Link to comment
Share on other sites

  • 0

If you wanted to get a little more in depth with the colors and whatnot, say maybe a different color for each Agenda type, you could use the workflow below.

Create an HTML block in the results section and disable the HTML editor for it. Add this code.

<p class="event">[@field:Agenda]</p>

<script type="text/javascript">

document.addEventListener('DataPageReady', function () {

 var blocks = document.querySelectorAll('[data-cb-name="DataCtnr"]');
 var events = document.getElementsByClassName('event');

for(var i = 0; i < blocks.length; i++) {
  if (events[i].innerText == "Check-Up") {
   blocks[i].style.cssText = "background-color: #a8e4a0; margin-bottom: 8px; border-radius: 4px; box-shadow: 3px 3px 4px gray;";
  } else if (events[i].innerText == "Follow-up") {
   blocks[i].style.cssText = "background-color: #add8e6; margin-bottom: 8px; border-radius: 4px; box-shadow: 3px 3px 4px gray;";
  } else if (events[i].innerText == "Ultrasound") {
   blocks[i].style.cssText = "background-color: #ffc8c8; margin-bottom: 8px; border-radius: 4px; box-shadow: 3px 3px 4px gray;";
  } else if (events[i].innerText == "Endoscopy") {
   blocks[i].style.cssText = "background-color: #ffcc99; margin-bottom: 8px; border-radius: 4px; box-shadow: 3px 3px 4px gray;";
  }
 }
});
  
</script>
<style>

.event{
display:none;
}

</style>

 

techcalendar.thumb.png.3d7564e4c6cc4850b33888ce088b4273.png

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...