How to Hide Columns in SharePoint Using jQuery
Microsoft SharePoint provides Web content management and document management for enterprises and businesses. The software allows employees to share and collaborate on company documentation from a central location. A designated SharePoint administrator can customize the document-sharing experience by hiding columns from view using the jQuery programming language. Custom Web Parts allow you to modify the appearance, content and behavior of your SharePoint site by adding jQuery code.
Instructions
-
-
1
Click “Start,” “Administrator Tools” and select “SharePoint Central Administration.”
-
2
Click “Modify My Page” from the top of the SharePoint page and select “Shared View.”
-
-
3
Click “Add Web Parts.” The page opens in design mode and the Web Parts pane appears.
-
4
Click “Custom Web Part” and click “Next.”
-
5
Copy and paste the following code into the Web part:
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js">
</script>
<script type="text/javascript">
function HideColumn(targetColumn, hideColumn) {
var columnObj = $("input[Title='" + hideColumn + "']");
$("input[Title='" + targetColumn + "']").bind('click',function() {
if($(this).is(':checked')) {
columnObj.closest("tr").hide();
}
else {
columnObj.closest("tr").show();
}
});
}$(document).ready(function() {
HideColumn('YourCheckboxcolumn','columntobehidden');
});
</script>Edit the “HideColumn” function values based on the columns you wish to hide.
-
6
Click “Add.”
-
1