Tag Info

Hot answers tagged

12

You can associate your custom action to a specific list by using the RegistrationId property. Example: <CustomAction ControlAssembly="MagicalProject.Actions" ControlClass="MagicalProject.Actions" ControlSrc="/_layouts/MagicalSite/MagicalPage.aspx" Description="This is my custom action which does magical ...


9

Jquery approach can be implemented, but I'm afraid it will be exceedingly complicated, because ribbon buttons can change their size if you resize the browser window (so the id of the button will be changed respectively, for example from ..-Large to ..-Medium, etc.), and also they're created after page load, dynamically with js - so you will need some ...


9

You can use the SPRibbon.TrimById(controlId) method to hide controls. http://msdn.microsoft.com/en-us/library/microsoft.web.commandui.ribbon.trimbyid.aspx This page lists the controlIDs: http://msdn.microsoft.com/en-us/library/ee537543.aspx You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For ...


8

As described in this article : Remove button from the Ribbon in SharePoint 2010, you can, with a feature, remove existing button. In your case, the feature.xml file should be : <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="RemoveDataSheetButton" ...


8

I know you asked for 2013 but I'm leaving the 2010 one here too in case anyone go crazy like you did. 2010 When any ribbon tab is open (other than the 'browse' one) it forces a 135px height on its container, which is a sibling of the #s4-workspace container, see where I am going? #s4-ribbonrow[style='height: 135px;'] ~ #s4-workspace #s4-leftpanel { ...


7

Put this in a content editor webpart <script> setTimeout(function() { var elem = document.getElementById("MSOZoneCell_WebPartWPQ2"); if(elem != null) { var dummyevent = new Array() dummyevent["target"] = elem dummyevent["srcElement"] = elem WpClick(dummyevent) } }, 2000) </script>


7

Bil! Looks like, you have missed Scaling element inside Groups element. Try add this to your definition: <Scaling Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.Scaling"> <MaxSize Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.MaxSize" GroupId="BilSimser.Ribbon.ListForm.Display.CustomerGroup" ...


7

When you click Check In button, method handleCommand called from javascript object SP.Ribbon.PageState.PageStateHandler (sp.ribbon.js) with commandId = "PageStateGroupCheckin" If you debug it, you can find that it executes this line at least: return SP.Ribbon.PageState.Handlers.showStateChangeDialog(properties['CommandValueId'], ...


6

just add .ms-dialog in front of the class you want to change, and it will only affect the modal dialogs: .ms-dialog .ms-cui-topBar2{ background-color: red; }


6

http://msdn.microsoft.com/en-us/library/ff458385.aspx: {SiteUrl} – The fully qualified URL to the site (Url). The SharePoint code proves it - here's the SPCustomActionElement.ReplaceUrlTokens method: internal static string ReplaceUrlTokens(string urlAction, SPWeb web, SPList list, SPListItem item) { if (string.IsNullOrEmpty(urlAction)) ...


6

You have two options here. One is to create simple toggle button with this markup: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="8DCC5B17-4B9E-41A7-BA51-65CBC6F8205D" Location="CommandUI.Ribbon" Sequence="10"> ...


6

You can specify Location="CommandUI.Ribbon.ListView" and RegistrationType="ContentType" with ID set to 0x01 for custom button to appear on ListView pages of all the lists. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="ShowHelloWorldButton" ...


6

Nicholas, The SharePoint 2010 ribbon is kind of a double-edged sword. I have seen many business users asking for "not having" the ribbon for the sake of branding. Then there were instances when people needed some extended administrative sections in SharePoint sites without the ribbon. The fact is no matter what you do, without the ribbon there are numerous ...


5

Use the fsObjType property: EnabledScript="javascript: var items = SP.ListOperation.Selection.getSelectedItems(); (items.length == 1 &amp;&amp; items[0].fsObjType == 0);"


5

You may well need to define your own GroupTemplate. The out of box ones - such as Ribbon.Template.Flexible - are not necessarily available. http://www.andrewconnell.com/blog/archive/2010/10/10/always-create-your-own-group-templates-with-sharepoint-ribbon-customizations.aspx


5

Just on the off chance: You are using Internet Explorer, right? If not, I'm afraid this is an IE-specific function; as I discovered when trying to pry it open with Chrome's dev tools.


5

I think you can go that way: Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event. You can use jQuery - http://api.jquery.com/click/ or regular js - ...


5

ExecuteOrDelayUntilScriptLoaded(function () { var pageStateGroupPublishValue = SP.Ribbon.PageState.PageStateCommands.pageStateGroupSubmitForApproval; SP.Ribbon.PageManager.get_instance().executeRootCommand(pageStateGroupPublishValue, window.g_CUIcommandProperties, { CommandId: pageStateGroupPublishValue }, null); }, "sp.ribbon.js");


5

This error means that you are trying to get some property that you didn't request explicitly. Maybe it's the Title field you're trying to use. Look at the example from here: function retrieveListItems() { var clientContext = new SP.ClientContext('/sites/MySiteCollection'); var oList = ...


5

Site Actions -> Navigation -> Show and Hide Ribbon Setting Make "Show Ribbon" and "Hide Ribbon" commands available to No should prevent the ribbon from disabling and requiring folks to enable it. It should also make it available all the time for everyone.


5

Create a JS file (HideScript.js) and paste the following code in it, which hides the ribbon for a certain page. Upload the JS file to some document library for e.g. "SiteAssets" function HideRibbon() { $("#s4-ribbonrow").hide(); var newHeight = $(document).height(); if ($.browser.msie) {newHeight = newHeight - 3; } ...


5

You can use SP.ListOperation.Selection.getSelectedItems() to get the currently selected item. Here is a code sample: var context = SP.ClientContext.get_current(); var selectedItems = SP.ListOperation.Selection.getSelectedItems(context); var item; for (i in selectedItems) { alert(selectedItems[i].id); } Once you have the id of the item, you will ...


4

Verify if JavaScript is fully enabled in IE... I think it's all disabled by default in Windows Server 2008.


4

According to Connect to Outlook – Tipps und Tricks (English version), it looks like you want something like this: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon" RegistrationType="List" ...


4

In addition to Steve B's solution, another 2010-only way of doing this is to set the following property to true: SPList.DisableGridEditing Unfortunately there appears to be no way to do this in 2007.


4

I noticed that the in the webpart div container there were two attributes, 'onkeyup' and 'onmouseup' which called a JavaScript function to trigger the list tools to show. I added a single line of jQuery code to remove those two attributes from the s4-wpcell div container and I no longer get the list tools to show on when I click anywhere inside the list ...


4

All Sharepoint element.xml modules are localized the same way. First of all, you need to deploy your resx files into SharePoint Resources mapped folder. After this, you can use following syntax to reference your localized resources: $Resources: ResourceFileNameWithoutExtension, ResourceName Code sample: <CustomAction Id="MyTestCustomAction" ...


4

Do you have the Microsoft Office client software (32-bit version) installed on your computer? This is necessary to support this function. You may also need to enable ActiveX controls if this is disabled in your browser.


4

As SPDoctor stated - it sounds like an issue with 64 bit install of Office. You cannot view a list in Datasheet view after you install the 64-bit version of Office 2010 Try installing the 2007 Office System Driver: Data Connectivity Components


4

It could also be turned off for the list. Check the List Settings > Advanced Settings, 'Datasheet' section.



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