如何使用OOB功能隐藏/显示“列表"列 [英] How to hide/show List column using OOB features
问题描述
我的客户需要仅对他可见的2列或更多列,以便他可以对其进行修改.他想在多个列表中实现此功能.他需要一些简单的实现方法..以便他可以自己实现..这可能是OOB功能吗?
My client need that 2 or more column in only visible to him so that he can modify it, He wanted to implement this functionality in multiple list. he need some simple method of implementation.. so that he can implement it by himself ..may be OOB feature?
有帮助吗?
谢谢
Anurag
推荐答案
没有基于当前用户隐藏列的OTB功能.但是您可以使用javascript来做到这一点:通过在其中添加javascript代码来修改列表形式.在此代码中,通过javascript对象模型检查当前用户名,并为 应该隐藏的字段:
there is no OTB feature for hiding columns based on current user. But you may do that by javascript: modify list forms by adding javascript code there. In this code check current user name via javascript object model and hide appropriate html elements for the fields which should be hidden:
var ctx = SP.ClientContext.get_current();
var currentUser = ctx.get_web().get_currentUser();
ctx.load(currentUser);
ctx.executeQueryAsync(
Function.createDelegate(this, function (sender, args) {
console.log("Login name: " + currentUser.get_loginName());
}),
Function.createDelegate(this, function (sender, args) {
console.log("Error: " + args.get_message()
}));
这篇关于如何使用OOB功能隐藏/显示“列表"列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!