Loading...

How to hide a column during printing a page using qListView webpart ?

How to hide a column during printing a page using qListView webpart ?

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #7210
      Anonymous
      Anonymous
      Participant

      Hello,

      n

       

      n

      Do you mean hide the edit buttons in the print page? if yes, it should have the chance to use the script hide them before you print. If you need the sample, please let me know.

      n

       

      n

    • #4651
      Anonymous
      Anonymous
      Participant

      Hi,

      I would like to hide ‘Edit’ column during the printout of a page that has multiple ‘qlistView’ web-parts.

      Is there a way with custom script or CSS that this can be achieved?

      Thanks.

    • #7213
      Anonymous
      Anonymous
      Participant

      Hi Mandeep,

      n

       

      n

      qListView uses a script function to print the page, so you need to modify this function to hide the button. Firstly, you need to navigate to the script file, the default path is: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\wpresources\WA.DataViewer. but if you deployed the QuickApps to the farm, you need to modify this file in all the servers. Open this file, locate to this fuction: GeneratePrintContent(webPartID, cssFiles, titleOfPrint), add below code into this function:

      n

       

      n

      htmlContent += '<script src="/_layouts/15/QuestSoftware/JQuery/jquery-1.8.2.min.js"></script>';

      n

      htmlContent += '<script>$(document).ready(function(){var eidtButtons = $("img[src$=\'edititem.gif\']"); $.each(eidtButtons, function(index, btn){$(btn).css("display","none");})})</script>';

      n

       

      n

      I assume you are using SP2013, so the jQuery path is under the ‘15’, if you are using SP2010, please remove the ‘15’ section. These code is using the CSS to hide all the buttons in the page.

      n

       

      n

    • #7212
      Anonymous
      Anonymous
      Participant

      Hi ,

      Thank you for your reply. This is precisely what I am looking for. If you can share the script would be great.

      Just to reiterate I have a pages that use multiple pListView webparts and I would like to use some script/css to hide the ‘Edit’ column from all of those during printing. Please review the attached image for a sample webpart.

      Thanks,

      Mandeep

Viewing 3 reply threads

You must be logged in to reply to this topic.