Hide reference selector when printing page

0
Hello, my web-page is designed so that when a users selects a title from a reference selector, all the attributes of that item appear on the page.   The reference selector and the attributes all reside in a container   My 'Print' button calls a nanoflow that prints the container to a PDF.   I would like the reference selector to be hidden when the Print button is clicked.   I added an HTML Snippet to my page with the following jQuery code but it doesn't work:   $('.mx-icon-lined mx-icon-print').click(function () {    $('#199.MasterJobList.JobDescription.referenceSelector1_bkj_8').hide()});   Is this because I'm trying to hide a specific element in a container that's being printed?   Cheers, J
asked
1 answers
1

Hi Jeffrey shabani, 

 

Add a Boolean Attribute : 

In the entity associated with your page, add a new Boolean attribute called something like IsPrinting

  1. Wrap the reference selector in a container.
  2. Set the container's visibility condition :  

$YourEntity/IsPrinting = false

 

 

  • Before printing the container, set the IsPrinting attribute to True
  • Use a Change Object action to update the attribute value.
  • After setting IsPrintingto True, proceed with the logic to generate the PDF.
  • Once the PDF is generated, set IsPrintingto back to false to make the reference selector visible again.

Another Option :

 

You can aslo use condition class : 

 

 

  • Add a class like printing-mode to your main container when Isprinting = true.
  • Use custom CSS to adjust the layout of the container and hide elements like the reference selector during printing.

.printing-mode .reference-selector-container {   

display: none;} 

 

Good Luck !!!

 

Thanks 

Jegadeesh 

answered