Wednesday, 25 January 2012

CustomActions for Item Ribbon on Lists

For Generic Lists and Issue Lists

I get help from these,

http://johanolivier.blogspot.com/2010/08/sharepoint-2010-ribbon-enabled-web-part.html
http://www.thorntontechnical.com/tech/sharepoint/sharepoint-2010-context-menu-item-with-custom-code

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="PrintActionMenu.PrintAction1"
RegistrationType="List"
RegistrationId="100"
GroupId="ActionsMenu"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1000"
ImageUrl="/_layouts/images/MyIconImage_32x32.png"
Title="Print List 100 A">
<UrlAction Url="{SiteUrl}/_layouts/PrintList.aspx?list={ListId}"/>
</CustomAction>

<CustomAction Id="PrintActionMenu.PrintAction2"
RegistrationType="List"
RegistrationId="1100"
GroupId="ActionsMenu"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1000"
ImageUrl="/_layouts/images/MyIconImage_32x32.png"
Title="Print List 1100 B">
<UrlAction Url="{SiteUrl}/_layouts/PrintList.aspx?list={ListId}"/>
</CustomAction>

<CustomAction
Id="PrintActionMenu.PrintAction3"
RegistrationType="List"
RegistrationId="100"
Location="CommandUI.Ribbon"
Sequence="1200">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button
Id="Ribbon.Documents.HelloWorldButton"
Alt="Hello World"
Sequence="1200"
Command="Show_HelloWorld"
Image32by32="/_layouts/images/MyIconImage_32x32.png"
LabelText="Print List 100 C"
TemplateAlias="o1"/>
</CommandUIDefinition>
</CommandUIDefinitions>

<CommandUIHandlers>
<CommandUIHandler
Command="Test"
CommandAction="javascript:alert('Hello World!');" />
</CommandUIHandlers>
</CommandUIExtension>

</CustomAction>


<CustomAction
Id="PrintActionMenu.PrintAction4"
RegistrationType="List"
RegistrationId="1100"
Location="CommandUI.Ribbon"
Sequence="1300">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button
Id="Ribbon.Documents.HelloWorldButton"
Alt="Prints Issue List"
Sequence="1300"
Command="Show_HelloWorld"
Image32by32="/_layouts/images/MyIconImage_32x32.png"
LabelText="Print List 1100 D"
TemplateAlias="o1"/>
</CommandUIDefinition>
</CommandUIDefinitions>

<CommandUIHandlers>
<CommandUIHandler
Command="Print"
CommandAction="{SiteUrl}/_layouts/PrintList.aspx?list={ListId}"
/>

</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>

</Elements>

No comments:

Post a Comment