Sharepoint CommandAction

Attribute

Description

Command

Required. The name of a command. The value of this attribute matches the value of a Command attribute on an element that defines a control.

CommandAction

Required. A script statement to execute when this handler is invoked. Microsoft SharePoint Foundation calls the eval method, passing in the value of this attribute.

The value of the attribute can contain substitution tokens that are transformed at rendering. The following tokens are recognized:

  • {ItemId} – ID (GUID) taken from the list view.

  • {ItemUrl} – Web-relative URL of the list item (Url).

  • {RecurrenceId} – ID of a recurrent item (RecurrenceID).

  • {SiteUrl} – The fully qualified URL to the site (Url).

  • {ListId} – ID (GUID) of the list (ID).

  • {ListUrlDir} – Server-relative URL of the site plus the list's folder.

  • {Source} – Fully qualified request URL.

  • {SelectedListId} – ID (GUID) of the list that is currently selected from a list view.

  • {SelectedItemId} – ID of the item that is currently selected from the list view.

EnabledScript

Optional.

Note

The EnabledScript attribute doesn’t work on custom actions deployed to the host web by an app for SharePoint.

A script statement that is executed to determine whether the command is enabled or disabled. The script expression should return a Boolean value, true if the command is enabled and false if not. If the ribbon is disabled, commands are grayed out and are not clickable.

As with the CommandAction attribute, the eval method is called with the value of this attribute as an argument. The EnabledScript attribute does not support the substitution tokens that are described for the CommandActionattribute.

posted on 2015-12-02 11:55  wjw413c  阅读(169)  评论(0编辑  收藏  举报

导航