2

I'm upgrading from SharePoint 2010 to 2013. In 2010, when an Item was selected in a listview, the ribbon would automatically switch to the Items tab.

In 2013, it does not.

How do I get the ribbon to Automatically switch to the Items tab when an item is selected in a listview?

2 Answers 2

5

In case anyone else needs it, This seems to work

function ShowItemsMenuWhenItemsSelected() {
    var oldToggleItemRowSelection2 = ToggleItemRowSelection2;
    ToggleItemRowSelection2 = function (ctxCur, tr, fSelect, a, b) {
        oldToggleItemRowSelection2(ctxCur, tr, fSelect, a, b)
        //var items = SP.ListOperation.Selection.getSelectedItems();
        if (ctxCur.CurrentSelectedItems > 0) {
            SelectRibbonTab("Ribbon.ListItem", true);  //set the Browse button as default
        }
        else {
            SelectRibbonTab("Ribbon.Read", true);  //set the Browse button as default
        }
    }
}
_spBodyOnLoadFunctionNames.push("ShowItemsMenuWhenItemsSelected");
1
1

In SharePoint 2013, selecting a document in a document library does not show the ribbon commands automatically and you need to manually click on the ribbon tabs (Files/ library) to use the commands. In SharePoint 2010, when you select a file checkbox in a document library, the 'Document' tab of the library tools ribbon automatically gets enabled with its commands. This is different in SharePoint 2013 where the Files/Library tab does not get automatically shown on document selection.

However, in SharePoint 2013, we can see that there is a "..." button appear in the list/library, by clicking it, we can choose to perform the most commonly used actions against the page, list or other components. That means we can perform the actions of our choice within the list/library area in a page. What's more, we also can add custom actions into this "..." menu to implement more functionalities.

This is an expected behavior in SharePoint 2013. The new UI reflects their “Minimal Download Strategy” in SharePoint 2013 that improves rendering performance when browsing content where large parts of the page do not change, which provides a more fluid navigation experience. You can read more on MDS here [link] http://blogs.office.com/2013/06/04/whats-new-in-sharepoint-server-2013-for-it-professionals/.

1
  • 2
    I understand that its the expected behavior in 2013, but my users do not want to have to click twice to execute ribbon commands. I'm looking for the javascript required to activate the tab when an item is selected.
    – RussGove
    Commented Nov 25, 2014 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.