In this SharePoint customization tutorial, we will discuss different ways
Below are 3 different ways we can hide/disable quick edit SharePoint 2013/2016/Online.
- Out of box feature
- JavaScript client object model
- CSS
SharePoint list disable edit using Out of box feature
First, we will see how wee can disable or hide SharePoint list quick edit using out of box feature.
The Quick Edit option not being turned on under “Advanced settings” option in List settings. The list has grouping enabled and this will disable the quick edit option.
You can find this option in below steps.
- Go to SharePoint list settings –> Advanced settings
- On Advanced settings, you will have an option as shown below. Make sure this is set to “No“
After this users will not able to use quick edit in SharePoint list. This works well for SharePoint 2013/2016/Online.
Disable quick edit SharePoint using JSOM (JavaScript object model)
You can hide the quick edit button for specific user in a group in SharePoint for different view. If you are new to JavaScript object model, read Working with JavaScript object model (jsom) in SharePoint 2013 or SharePoint Online.
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
ExecuteOrDelayUntilScriptLoaded(getgroup, "sp.js");
});
function getgroup() {
var clientContext = new SP.ClientContext.get_current();
var currentUser = clientContext.get_web().get_currentUser();
clientContext.load(currentUser);
var allsitegroup = clientContext.get_web().get_siteGroups();
var group = allsitegroup.getByName("The Specific Group Name");
var groupusers = group.get_users();
clientContext.load(groupusers);
clientContext.executeQueryAsync(function () {
var groupUserEnumerator = groupusers.getEnumerator();
while (groupUserEnumerator.moveNext()) {
var groupUser = groupUserEnumerator.get_current();
if (groupUser.get_id() == currentUser.get_id()) {
$("#Hero-WPQ2 a:nth-child(2)").remove();
var tempHtml = $("#Hero-WPQ2").html();
tempHtml = tempHtml.replace('or this list', '');
$("#Hero-WPQ2").html(tempHtml);
}
}
}, function () {
console.log("error");
});
}
</script>
Just add the above code in a script editor web part in SharePoint list view page.
SharePoint list disable quick edit using CSS
You can also write custom CSS inside script editor web part to hide Edit button in a list in SharePoint Online/2013/2016.
<STYLE>
.ms-heroCommandLink, .ms-heroCommandLink:visited {
color: #0072c6;
text-decoration: none;
display: none;
}
</STYLE>
You can see in the above pic, the Edit this list is not appearing.
You may like the following SharePoint list and document library tutorials:
- SharePoint employee of the month web part
- How to enable tree view in SharePoint
- How to create a survey in SharePoint
- How to embed google maps in SharePoint
- Site Feed web part in SharePoint
- SharePoint modern list view customization example
- SharePoint list delete title column
- Redirect to a different page after adding new list items in SharePoint
Hope this SharePoint tutorial explains, how to disable/hide quick edit in list in SharePoint 2013/2016/Online.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).