Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I create a View Ribbon-scoped custom action using SPD 2010 that runs some Javascript. If I create it in an ECT list I can use it with multiple items. However, if I create it in a standard SharePoint list, it automatically grey's out when more than one item is checked.

Can this behavior be changed from SPD? Using JSOM? Some other tool or VS? (In that order)

share|improve this question
add comment

2 Answers 2

SPD is rather clever. If you put tokens like {SelectedItemId} into the 'url' it makes sure the button is only enabled if a single item is selected, but if not the it's turned on always.

Try this as an example:

javascript:alert(SP.ListOperation.Selection.getSelectedItems().length)
share|improve this answer
    
Good to know. My URL looks like this . . . javascript:$.getScript("http://intranet/path/popNewOpp.js"); . . . so not sure what else might be hapening. –  Toadmyster May 11 '12 at 20:21
add comment
up vote 1 down vote accepted

Here's the quick and dirty. SPD creates the UserCustomActions definition for the list with code to only display for a single item. Using SP Manager, I simply edited the script to allow for any number of selected items to enable the icon in the ribbon. (Changed ==1 to >0) SP Manager Left Panel!enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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