1

is there some way I can hide the "New item or edit this list" link above a list's ListViewWebPart? I have tried searching for the link's Action ID online but found nothing.

EDIT: For clarification, I can't set the toolbar type to "None". Please see my other question here for clarification.

1

If you edit the Web part, you can edit the toolbar type to No Toolbar. Your New Item and Edit this list effectively disappears :)

enter image description here

Edit

If that removes your custom action, you need to hide the two buttons by using JQuery (or any other framework of your choice). The following code hides the entire toolbar, but you need to find the ID or class of each button to make the code workk for you.

<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> 
<script>
$( document ).ready(function() 
{
var test=  $('tr').find('td.ms-list-addnew.ms-textXLarge.ms-list-addnew-aligntop.ms-soften');
console.log(test);
test.hide();
});
</script>

Reference: How I can hide the new item/edit toolbar in SharePoint 2013 via JQuery

  • I can't set the toolbar type to none as I also hide the ribbon's "New" group using a custom action and SP seems to have a bug where setting the toolbar type to "None" will negate that custom action. I don't know why SP does this. That's why I wanted to hide the "New item or edit this list" with with a custom action approach. – LeonidasFett Aug 20 '18 at 8:50
  • I edited my question. – LeonidasFett Aug 20 '18 at 8:53
  • @LeonidasFett I edited my answer accordingly. – Benny Skogberg Aug 20 '18 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.