如何从Sharepoint列表显示表单中隐藏列 [英] How to hide columns from Sharepoint list display form
问题描述
我的要求是从列表的显示表单中隐藏列.但这些列应该对新表单和编辑表单可见.
My requirement is hide the columns from list's display form. but the columns should be visblible to new and edit forms.
请提出建议.
谢谢.
推荐答案
有两种选择可以实现:
选项1:
使用SharePoint Designer打开列表时,可以看到新建,编辑和显示"表单,如下所示:
When you open the list using SharePoint designer, you can see the New,Edit and Display Form as shown below :
由于您只想自定义显示"表单,因此请打开该表单并找到要隐藏的列的html标签.
Since you want to customize only the Display form, open the form and find the html tag for the column that you want to hide.
发现列行后,将其显示样式设置为 没有,方法是在< tr>中添加"style =" display:none"标签.
Once you spot the column row, set its display style to none by adding "style=’display:none’" to the <tr> tag.
这将仅在显示表单中隐藏该列.在新建/编辑"表单中,该列仍将可见.
This will hide the column from only the display form . In New/Edit form the column will still be visible.
选项2:
您还可以将jQuery添加到显示表单中,并获取column元素并将其隐藏.
You can also add jQuery to the display form and get the column element and hide it.
(文档).ready(function(){
(document).ready(function(){
(" nobr:contains('My Column ')'').closest('tr').hide(); });
("nobr:contains('My Column')").closest('tr').hide(); });
jquery Column Hiding
此致
Priyan
这篇关于如何从Sharepoint列表显示表单中隐藏列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!