继续前面的一篇博客,sharepoint 2010 怎样在列表中加入功能菜单操作项。这次主要是记录下,在Ribbon区域加入功能button。比如加入收藏button。例如以下图所看到的:
1。
还是一样。加入一个空元素,CollectionRibbonItem
改动XML文件代码,在
<CustomAction
Id&#61;"Ribbon.Library.Actions.AddAButton"
Location&#61;"CommandUI.Ribbon"
RegistrationId&#61;"101"
RegistrationType&#61;"List"
Title&#61;"Add a Ribbon Button">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location&#61;"Ribbon.Library.Share.Controls._children">
<ButtonId&#61;"Ribbon.Library.Share.NewRibbonButton"
Command&#61;"NewRibbonButtonCommand"
Image16by16&#61;"/_layouts/15/2052/images/formatmap16x16.png"
Image32by32&#61;"/_layouts/15/2052/images/formatmap32x32.png"
LabelText&#61;"收藏"
TemplateAlias&#61;"o2" />
CommandUIDefinition>
CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command&#61;"NewRibbonButtonCommand"
EnabledScript&#61;"Javascript:SetEnableRibbonSubscribe();"
CommandAction&#61;"Javascript:alert(&#39;Hello, world&#39;);" />
CommandUIHandlers>
CommandUIExtension>
CustomAction>
2。
部署到站点上&#xff0c;就能够了。
參考资料&#xff1a;https://msdn.microsoft.com/zh-cn/library/ee537543.aspx
广州京微信息科技有限公司,.微软sharepoint解决方式提供商。