Tag Info

Hot answers tagged

4

They have a JavaScript API for this: http://msdn.microsoft.com/en-us/library/office/ff408647(v=office.14).aspx You can even add command ui extension like you have them. var context = new SP.ClientContext.get_current(); this.site = context.get_web(); var customAction = this.site.get_userCustomActions().add(); ...


4

you can use $().SPServices <script type="text/javascript" src="/sites/sprc/Resources%20%20jQuery/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/sites/sprc/Resources%20%20jQuery/jQuery%20SP%20Services/jquery.SPServices-0.5.4.min.js"></script> <script type="text/javascript"> function StartWorkflow(ItemURL, ...


3

Yes this option was removed in 2013, it was introduced in 2010, but now to add the list you have to follow the 2 steps of creating it then add it to your page.


2

Since you don't want to use jQuery, you can use CSS to hide the ribbon buttons. For ex. #RibbonContainer a[id$="Datasheet-Large"], #RibbonContainer a[id$="Datasheet-Medium"], #RibbonContainer a[id$="CreateView-Large"], #RibbonContainer a[id$="CreateView-Medium"] #RibbonContainer span[id$="ModifyView-Medium"] { display: none !important; } Use ...


2

This can be done by creating a CustomAction. Specify Location="CommandUI.Ribbon.DisplayForm" in order to place a button in Display form. Here is an example: <CustomAction Id="ExportVersionHistory.DisplayForm" RegistrationType="ContentType" RegistrationId="0x01" Location="CommandUI.Ribbon.DisplayForm" Rights="ViewListItems"> ...


2

Change if (location.pathname.search('test.aspx') = 0) { To this: if (location.pathname.search('test.aspx') == 0) { You are assigning zero to location.pathname.search('test.aspx'), not testing if it is zero. Second part: window.SelectRibbonTab = function (SelectRibbonTab) { return function ("Ribbon.Read", true) { if ...


2

Use JS library SPServices from codeplex to get current user permissions: http://spservices.codeplex.com/wikipage?title=GetRolesAndPermissionsForCurrentUser And then just hide the menu item with JS. The hardest part is to obtain the permissions, which can be done smoothly with SPServices. You can add this JS to edited master page, or develop custom control, ...


2

I was originally going to suggest this location: Ribbon.WikiPageTab.PageActions But i did a quick search and this guy's blog has more detailed information. http://sanderschutten.blogspot.com/2010/05/adding-buttons-to-mss2010-ribbon.html


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: ...


2

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 ...


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 ...


2

Using PowerShell you can do this using $spWeb = Get-SPWeb "http://sharepointSiteUrl" $spWeb.AllProperties["__DisplayShowHideRibbonActionId"] = $false.ToString() $spWeb.Update() C# spWeb.AllProperties["__DisplayShowHideRibbonActionId"] = false.ToString(); spWeb.Update();


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 ...


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 ...


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 ...


1

This can be achieved to a certain extent if you, for example, create a list view with appropriately formatted list items and a SharePoint Designer custom action with a javascript like javascript:{ (function() { var myctx = SP.ClientContext.get_current(), selected = SP.ListOperation.Selection.getSelectedItems(myctx), list = []; for (var item in ...


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 ...


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> ...


1

This is not possible with pure SharePoint Online/O365.


1

Maybe this can help you. It is a farm solution that permit to copy element of a list. The button copy is in the ribbon tab. SP List Item Copy enables a user to copy SharePoint list items. User can use this feature easily via Ribbon UI.


1

You can call javascript function in UrlAction: <UrlAction Url="javascript:YourMethod();" /> Make sure you have js reference in master page or you can add it using following lines in your element file: <CustomAction ScriptSrc="/scripts/myScript.js" Location="ScriptLink" Sequence="1"> </CustomAction>


1

I had a question similar to this come up a while ago regarding creating a new style for the ribbon. I would guess you should be able to replace existing with your own this way. If I understand the question that's what you're trying to do. Hopefully this helps you out. Open Designer with the appropriate site collection that you want the style to appear. Go ...


1

Yes this is true, as per technet. Items 30,000,000 per list Supported You can create very large lists using standard views, site hierarchies, and metadata navigation. This value may vary depending on the number of columns in the list and the usage of the list. http://technet.microsoft.com/en-us/library/cc262787(v=office.15).aspx#ListLibrary But ...


1

I've had this problem before and never explored a solution until now. Don't use the script editor, instead just open the view aspx within SharePoint Designer and in 'PlaceHolderAdditionalPageHead' you can add your script without loosing the ribbon. Tested in SP 2013 on AllItems.aspx <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" ...


1

Just want to mention something upfront, Autohosted apps will no longer be available at the end of the month. Microsoft is putting an end to them, and developers will no longer be able to deploy them. Currently running apps will continue to run for a short time, but are expected to be taken down as well. Ribbons cannot contain JavaScript in them. That you ...


1

This would help. There’s a JavaScript API for Creating Ribbons! http://dbremes.wordpress.com/2011/01/16/theres-a-javascript-api-for-creating-ribbons/ Intro to Manipulating the SharePoint 2010 Ribbon with JavaScript http://sharepointtaproom.com/2011/09/09/intro-to-manipulating-the-sharepoint-2010-ribbon-with-javascript/ Plus, surely, the same stuff can be ...


1

Nevermind my previous answer, forget I said anything. In javascript, you can create a set elements without having to write anything in the original html document. functions like *.createElement(), *.class(), and *.id() can let you create and configure your html element. Here is the link to all the Javascript functions for this. And here is a link to add ...


1

To add to Aveenav's answer, if you need the trigger to be purely JS, why not add the CSS in the page head via the native JavaScript API? Without jQuery it would look something like: var yourCss = document.createElement('style'); yourCss.type = 'text/css'; yourCss.innerHTML = '#RibbonContainer a[id$="Datasheet-Large"] ... { display: none !important; }'; ...


1

I'm not sure if this solution is possible in SPD. But in xml definition you can use EnabledScript parameter in CommandUIHandler, where you can put javascript code and check if specific page/list/view is loaded. link to similar answer Example: <CommandUIHandler Command="Ribbon.ListItem.CustomGroup.Controls.BtnSayHello.Command" ...



Only top voted, non community-wiki answers of a minimum length are eligible