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
Use EnabledScript property in CommandUIHandler. Example:
EnabledScript="javascript:
function enableButton() {
var items = SP.ListOperation.Selection.getSelectedItems();
var ci = CountDictionary(items);
if (ci > 0) {
return true;
}
}
enableButton();"
Also,
EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length > 0;"