I have created a document library programmatically using C#. Now, I want that when any particular document library created then its 'add document' button should not view or if possible then whole panel of add/edit/delete should be invisible. I am working on Office365 & sandbox solution.
2 Answers
You could hide a New
button in List View using:
CSS
button.js-listview-qcbNewButton {
display:none;
}
jQuery
$('button.js-listview-qcbNewButton').hide();
How to apply the changes:
- Switch the page (
AllItems.aspx
) into edit mode - Add
Script Editor
orContent Editor
web part into page. - For JavaScript code, put the specified code by wrapping it using
script
tag, for example:<script type="text/javascript">$('button.js-listview-qcbNewButton').hide();</script>
- Save the page
whole panel of add/edit/delete should be invisible You have to create new form and add this CSS into its PlaceHolderMain section
$('.ms-dlgFrame').load(function () {
$('.s4-pr.s4-ribbonrowhidetitle', frames[1].document).hide();
});
For more info refer to
http://phinotworking.com/hiding-the-ribbon-when-using-sp-ui-modaldialog-showmodaldialog/