here am adding some custom Actions to one document library and i want to make it visible only when i will select any item from that specific library,am implementing this thing foe sharepoint-online so here a can to do anything with C#,so is it possible only with designer and JSOM?

1 Answer 1


Use EnabledScript property in CommandUIHandler. Example:

function enableButton() {
var items = SP.ListOperation.Selection.getSelectedItems();
var ci = CountDictionary(items);
if (ci > 0) {
    return true;


EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length > 0;"

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.