IVAN88 Posted February 29 Report Share Posted February 29 Hi, I have a Calendar datapage, and want to hide 1 column/field by condition. For example : if Room = X then hide Field "Notes" else Show field "Notes" How can I do this ? Rgds, Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted February 29 Report Share Posted February 29 Hello @IVAN88, In my opinion, the easiest way is to use Calculated Field instead of the Notes field. For example: CASE WHEN [@field:Room] < 10 THEN [@field:Notes] ELSE '' END So, when the condition to display the field is met the field is displayed, if not - the field is empty. Then JavaScript can hide the label of the Calculated Field when it is empty. <script> document.addEventListener('DataPageReady', hideFieldHandler); function hideFieldHandler() { const calcFields = document.querySelectorAll('dl dd:nth-of-type(2)'); //2 is the position of the Calculated field const calcLabels = document.querySelectorAll('dl dt:nth-of-type(2)'); //2 is the position of the Calculated field calcFields.forEach((field, index) => { if(field.innerHTML == " "){ calcLabels[index].style.display = 'none'; } }) } </script> In this example, the Calculated field is the second field on the Calendar page, so I reference it as 'nth-of-type(2)'. The digit should be replaced according to your page layout. Feel free to update the thread if you have further questions. Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted February 29 Report Share Posted February 29 Hi @IVAN88 - you may also check this forum post Quote Link to comment Share on other sites More sharing options...
0 IVAN88 Posted March 4 Author Report Share Posted March 4 Thanks @CoopperBackpack it works as expected CoopperBackpack 1 Quote Link to comment Share on other sites More sharing options...
Question
IVAN88
Hi,
I have a Calendar datapage, and want to hide 1 column/field by condition. For example :
if Room = X then hide Field "Notes" else Show field "Notes"
How can I do this ?
Rgds,
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.