Monday 27 May 2013

hiding the sharepoint list calculated columns using jquery


Reference Url

http://www.infinitedreamers.co.uk/sharepoint-2007-hide-calculated-fields/

SharePoint 2007 – Hide calculated fields in display form

The following steps describe how to hide calculated columns when viewing an item in a SharePoint 2007 list using SharePoint Designer 2007 and jQuery.
  1. Download the latest version of jQuery.
  2. Upload the file to a document library in your SharePoint site.
  3. Open your site with Microsoft Office SharePoint Designer (a free download).
  4. Open ‘default.master’ – found under _catalogs/masterpage (Master Page Gallery).
  5. Add <script type=”text/javascript” src=”url to your/jquery-1.6.2.min.js”></script> just above the </HEAD> tag. SharePoint 2007 default.master changes
  6. Save and publish this file.
  7. Open ‘DispForm.aspx’ for your list – found under Lists/your list name/
  8. Add the following script at the bottom of the ‘PlaceHolderMain’ content zone:
    <script type="text/javascript"> $(document).ready(function(){ $("[id=SPFieldCalculated]").parent("tr").css("display","none"); }); </script>
    SharePoint 2007 DispForm.aspx Changes
  9. Save this file.
I stumbled upon this technique when a customer did not want the 8 calculated columns used as filtering criteria in a view visible when viewing the item.

1 comment: