Well, the title of the post explains very well what was the objective and everybody knows that this is not the best way, but editing the permissions was causing issues somewhere else so we decided to do this.
This is the enemy:
And in order to hide it we added a Content Editor Web Part and then clicked in the Source Editor Button:
There we added this script:
<script type="text/javascript" > var allMenuItems = document.getElementsByTagName('ie:menuitem'); for(var i = 0; i < allMenuItems.length; i++ ) { try { if (allMenuItems[i].text.toLowerCase() == "edit in datasheet") { var parentNodeOfMenuItem = allMenuItems[i].parentNode; parentNodeOfMenuItem.removeChild(allMenuItems[i]); } } catch(err) {} } </script>
It could look a bit weird, but SharePoint won’t mind. Then we should click Save.
After that, in the Appearance group of the web part we could change the parameter Chrome Type to “None” (Or Layout –> Hidden) to make the CEWP invisible to the users.
And that’s all.
Enjoy!
No comments:
Post a Comment