Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, April 8, 2013 9:12 AM
Hi Everyone,
We have sharepoint list with five columns.In that, one column is dropdown list with some values(yes,no,other).
So whenever list item is updated with dropdown value "no" ,that item shouldn't be visible to all users.
How can we hide list item record based column value?
Any suggestions would be appreciated.
All replies (3)
Monday, April 8, 2013 9:30 AM ✅Answered | 1 vote
Hey,
1.) Go to the list view which you are showing to the user.
2.) From the ribbon. Click on Modify View.
3.) In that Define filter condition like show items only when your dropdown value is not equal to no.
Thanks.
Tuesday, April 9, 2013 7:42 AM ✅Answered
Hi Nag,
Using ECMA script find get the value of the field, and based on the value hide the column using jacasvript.
Add all the script and ECMA script in display form using content editor webpart.
Please find the below javascript to hide the entire column.
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideFields");
function findacontrol(FieldName) {
var arr = document.getElementsByTagName("!");
// get all comments
for (var i=0;i < arr.length; i++ )
{
// now match the field name
if (arr[i].innerHTML.indexOf(FieldName) > 0)
{ return arr[i]; }
}
}
function hideFields() {
var control = findacontrol("Title");
control.parentNode.parentNode.style.display="none";
control = findacontrol("Procedure Number");
control.parentNode.parentNode.style.display="none";
}</script>
Tuesday, April 9, 2013 12:32 PM ✅Answered
Based on Fileld value: Yes or No, it should be visible or Hidden to All End-users except Administrators/Other group of users?
If so, You can use a Event Receiver to set permission on list items.
Event Receiver to Set Item Level Permissions based on List Column Value