Tag Info

New answers tagged

1

here the answer: <script type="text/javascript"> function hideEdit() { var edit = document.getElementById("Ribbon.ListForm.Display.Manage.EditItem-Large"); edit.style.display = "none"; } _spBodyOnLoadFunctionNames.push("hideEdit"); </script> Or Enable/Disable ribbon button based on current item value of a ...


0

Did you mean EditForm.aspx? Cause for Doc libaries there's no NewForm.aspx To hide it using CSS: #Ribbon a[id$="Cancel-Large"] { display: none !important; } To hide it using jQuery: $("#Ribbon a[id$='Cancel-Large']").hide(); I would suggest using a combination of both and use remove() instead of hide(). You could add the jQuery script using JSLink ...


0

SharePoint Loads the ribbon at last and your jquery/javascript code to hide the cancel button is executed earlier. Write your code inside settimeout method. E.g. setTimeout(function() { $('#Ribbon.DocLibListForm.Edit.Commit.Cancel-Large').hide(); }, 5000);


1

So if SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult, returnVal) is not working you can try this: Closing the Dialog Autohosted and Provider-hosted Apps for SharePoint are hosted outside of SharePoint, and as such can’t leverage typical SharePoint scripts to close the dialog (ex: SP.UI.ModalDialog.commonModalDialogClose()). Luckily, I ...


0

If you set up button as "navigate to url", it will be a active even with multiple selected list item.


1

var clientContext, hostweburl, parentContext, parentWeb, listItems; clientContext = new SP.ClientContext.get_current(); hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); parentContext = new SP.AppContextSite(clientContext, hostweburl); parentWeb = parentContext.get_web(); var id = GetItemID(); // Gets Selected item's ID var listId ...


3

var clientContext = SP.ClientContext.get_current(); // Gets current site context var id = GetItemID(); //retrieve selected list item id to update data var listId = SP.ListOperation.Selection.getSelectedList(); var oList = context.get_web().get_lists().getById(listId); this.oListItem = oList.getItemById(id); function GetItemID() { var selectedItems ...


0

This worked in my environment: #Ribbon\.ListForm\.Display\.Manage-LargeMedium-1-1{ display:none; } Use your browser's dev tools to find the exact 'id' in your instance. Here's a screenshot:


0

If you want to force this type of behaviour for users, then F.Aquino's solution is what you need. Otherwise, there is one out-of-the-box solution for users: use the "Focus on Content" button on the top-right side of the ribbon.


2

Firstly just to warn you that trying to hide the "Share with" option in SharePoint 2013 can be a bit like playing 'whack-a-mole'. The following CSS will hide this option on the context menu and also the ribbon bar (which was probably going to be your next question:-)). We normally have this in a CSS file that's loaded by a custom master page used in all ...


1

SharePoint Designer 2013 can be used to create a ribbon button for SharePoint list or library. Once clicked, the button will perform a custom action function. Step 1: In SharePoint Designer 2013, open the site containing the library or list where the custom action button on the ribbon will be deployed. Step 2: Open the library or list from the left ...


2

You can use the SPRibbon.TrimById(controlId) method to hide controls. You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For example, you could use DoesUserHavePermissions on the page's list item: ...


0

please create a javascript function PreSaveAction() in your page layout. In presave action will fire when you click on save button. You can write any javascript code in this function which needs to be perform just before saving the page. This is working fine in sharepoint list, but I have not tried in publishing page


-1

Try this code var tab = ribbon.getChild(your_tab_id);


1

This is not possible with pure SharePoint Online/O365.


1

If you're a bit of a perfectionist as I am, and after a "right" way of doing things, and don't particularly like js/css hacks, then you might want to consider the custom action approach: <CustomAction Id="RemoveRibbonButton" RegistrationType="List" RegistrationId="{GUID-OF-YOUR-LIST-HERE}" Location="CommandUI.Ribbon.NewForm" > ...


1

You will want to modify the NewForm.aspx page as Colbs described in his answer, although the use of JavaScript is not strictly necessary. The "Commit" section's container in the Edit ribbon should have a unique ID assigned to it, which you can find by inspecting the page source. Once you've found the ID, you can set it's CSS Display property to "none" by ...


0

In SharePoint Designer, navigate to the NewForm.aspx file under your specified list. Edit this in advanced mode and within the 'PlaceHolderAdditionalPageHead' place this script (Ensure jQuery is being referenced in the MasterPage being used): <script> $( document ).ready(function() { $( "a:contains('Save')" ).css( "visibility", "hidden" ); ...


0

I realize that this response is very delayed but I figured out how to do this after a lot of reverse engineering and maybe this will save someone else some time. To better understand and improve on this example, it will be helpful to: Have an understanding of how a ribbon is created and how commands are registered Take a look at the sp.ribbon.js file and ...


1

The solution is similar to the one I provided in this accepted answer: Attach a Javascript function to an OOTB ribbon button. Here's the code, adopted for your case: <CustomAction Id="TrackDownloadsAction" RegistrationType="List" RegistrationId="100" Location="CommandUI.Ribbon"> <CommandUIExtension> <CommandUIDefinitions> ...



Top 50 recent answers are included