list 如何在 Sharepoint 中隐藏、禁用日历列表项字段
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1068656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to hide, disable calendar list item fields in Sharepoint
提问by Keraj
I want to hide or make some fields read only on editform.aspx. I follwed the example on this page, but without deliting the "original" webpart list. I hide the original webpart and created a new custom list from the original list. Then i was able to apply xsl on the custom list to hide or to make the field "read only". Unfortunately the recurring events stopped working or where totaly messed up. Some times i've got error messages when I clicked on specific event in calendar view. The calendar list works fine and the fields are hidden or disabled in "Edit mode" when the event is not recurring. My question is. Is there any other way to hide or disable the items for specific security group or sharepoint group on calendar list?
我想在editform.aspx 上隐藏或使某些字段只读。我遵循了此页面上的示例,但没有删除“原始”webpart 列表。我隐藏了原始 webpart 并从原始列表中创建了一个新的自定义列表。然后我能够在自定义列表上应用 xsl 以隐藏或使该字段“只读”。不幸的是,重复发生的事件停止工作或完全搞砸了。有时,当我在日历视图中单击特定事件时会收到错误消息。日历列表工作正常,当事件不重复发生时,这些字段在“编辑模式”中被隐藏或禁用。我的问题是。有没有其他方法可以隐藏或禁用日历列表上特定安全组或共享点组的项目?
回答by Alex Angas
If SharePoint Designer is an option, then this blog post from Laura Rogersshows how you can display SharePoint fields by permission level. It should work with a calendar list.
如果 SharePoint Designer 是一个选项,那么Laura Rogers 的这篇博文将展示如何按权限级别显示 SharePoint 字段。它应该与日历列表一起使用。
This will give you complete control over the solution without the need for a third-party product.
这将使您无需第三方产品即可完全控制解决方案。
回答by tag
I think it is little bit hard to do that. Otherwise there should be not so much such third party tools like SharePoint Column View Permission, Bamboo also has such tool.
我认为做到这一点有点困难。否则应该没有那么多像SharePoint Column View Permission这样的第三方工具,Bamboo也有这样的工具。
Take a look at this if you want make it happen through code stackoverflow.com/questions/1058232. But I am not sure it works in calender.
如果您想通过代码stackoverflow.com/questions/1058232实现它,请查看它。但我不确定它是否适用于日历。
回答by boflynn
Two tools I've run across to do what you're looking for:
我遇到的两个工具可以做你正在寻找的东西:
- SPListDisplaySetting- "SharePoint feature (for WSS 3.0 and MOSS) providing advanced settings to customize list form rendering in new, display and edit mode."
- SPListDisplaySetting- “SharePoint 功能(适用于 WSS 3.0 和 MOSS)提供高级设置以在新的、显示和编辑模式下自定义列表表单呈现。”
You can specify that certain fields only show up on edit, new, or display pages and only for certain groups, or to hide them completely.
您可以指定某些字段只显示在编辑、新建或显示页面上,并且只显示给某些组,或者完全隐藏它们。
My only problem with this is that the installer doesn't quite work. However, a user has posted working instructions on the discussion board.
我唯一的问题是安装程序不能正常工作。但是,用户已在讨论板上发布了工作说明。
- SharePoint Tool Basket - List Columns Manager- "This feature allows site collection administrators to view all the columns of a list including hidden/read-only ones and gives column details such as the internal name, Guid, Type.."
- SharePoint 工具篮 - 列表列管理器- “此功能允许网站集管理员查看列表的所有列,包括隐藏/只读列,并提供列详细信息,例如内部名称、Guid、类型......”
回答by Keraj
I found a pretty nice solution at Cleverworkarounds. The code is writen in javascript so the script does not actually remove the fields, which in my case is necessery, but it does hide the fields. Me, I need to stick to SharePoint List Form Extensions due to some sensitive data our customers have and want to be remove for some users. Laura Rogers solutions is good too, but with Cleverworkarounds you don't need to use Sharepoint Designer.
我在Cleverworkarounds找到了一个非常好的解决方案。代码是用 javascript 编写的,因此脚本实际上并没有删除字段,这在我的情况下是必需的,但它确实隐藏了字段。我,由于我们的客户拥有并希望为某些用户删除一些敏感数据,我需要坚持使用 SharePoint 列表表单扩展。Laura Rogers 的解决方案也不错,但通过 Cleverworkarounds,您无需使用 Sharepoint Designer。
回答by Karl Cartlidge
One option is to download the Sharepoint Manager from CodePlex. Install it on the server (it uses the object model) and you get simple access to a whole heap of stuff including, on a per-field-per-list basis, whether a specific column is hidden in it's entirety (even from the list settings), or hidden from the display form, the edit form or both. It's a matter of setting a true/false dropdown and clicking save. There is also the option for making columns readonly too.
一种选择是从 CodePlex 下载 Sharepoint Manager。将它安装在服务器上(它使用对象模型),您可以轻松访问整个堆的内容,包括在每个字段每个列表的基础上,特定列是否完全隐藏(甚至从列表中)设置),或从显示表单、编辑表单或两者中隐藏。这是设置真/假下拉列表并单击保存的问题。也可以选择将列设为只读。
It's all or nothing in terms of permissions though - whatever you choose applies to everyone who can access that area.
不过,就权限而言,它是全有或全无的 - 无论您选择什么,都适用于可以访问该区域的每个人。
回答by A Ghazal
You can hide items in the calendar list using JQuery. Please follow the steps below: - From the Calendar tab Customize List category select -> Form Web Parts -> Default New Form - Select the Insert tab and from Web Parts category -> click Web Part. - Choose Media and Content, then choose Content Editor and click Add. - Place the Content Editor below your form and click inside the Content Editor - Click on Format Text tab -> Markup category -> Click on HTML -> Edit HTML Source Add the following code:
您可以使用 JQuery 隐藏日历列表中的项目。请按照以下步骤操作: - 从日历选项卡自定义列表类别选择 -> 表单 Web 部件 -> 默认新表单 - 选择插入选项卡并从 Web 部件类别 -> 单击 Web 部件。- 选择媒体和内容,然后选择内容编辑器并单击添加。- 将内容编辑器放在表单下方并在内容编辑器内部单击 - 单击格式文本选项卡 -> 标记类别 -> 单击 HTML -> 编辑 HTML 源代码 添加以下代码:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$(function() {
$("td.ms-dttimeinput").hide();
$("span[title='All Day Event'] > input").attr("checked","checked");
$("tr:has(span[title='Recurrence'])").not("tr:has(tr)").hide();
$("tr:has(span[title='All Day Event'])").not("tr:has(tr)").hide();
$("tr:has(span[title='Workspace'])").not("tr:has(tr)").hide();
});
</script>
The above code also puts the "All Day Event" to be checked true. Hope this would be useful ..
上面的代码还让“全天事件”被检查为真。希望这会很有用..