0

I have a webpart from a child list on the parent display form, and this is the only area that I would like for users to add new items to the child list. Restricting permissions on the list to remove edit/delete from everyone wouldn't work because that would also affect their permissions on the web part of that list. Is there a way to hide the "new item" button only on the actual list?

If making the chrome type "No Toolbar" should remove this, it's not doing it. Here are the screenshots:

What I want hidden/disabled only on this webpart:

New Item

What I changed based on recommendation below:

What I changed

2 Answers 2

2

I am assuming you are working on a SharePoint custom solution in Visual Studio. Add an empty element to your SharePoint solution. Add the following Xml to the Elements.xml file of the added element:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction RegistrationId="Your List Id Here" RegistrationType="List" Location="CommandUI.Ribbon" Id="HideRibbonButtons"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.ListItem.New.NewListItem"/> </CommandUIDefinitions> </CommandUIExtension> </CustomAction> </Elements>

Make sure that the element is added to the feature and deploy.

1

use this javascript to hide it

<script type="text/javascript">
var elem = document.getElementById("Ribbon.ListItem.New-LargeLarge");
elem.style.display = "none";
</script>
8
  • even admin wont see that.did u saved the changes properly? try it once again.and see what Toolbar type contains Commented Apr 17, 2014 at 4:46
  • I just refreshed and the list web part still says "Toolbar Type: No Toolbar"
    – Dinerdo
    Commented Apr 17, 2014 at 4:51
  • did u pressed stop edit on page? Commented Apr 17, 2014 at 4:53
  • Yes, and I refreshed a few times.
    – Dinerdo
    Commented Apr 17, 2014 at 4:56
  • can you just put the screen shots to know your problem exactly Commented Apr 17, 2014 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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