您的位置:首页 > 其它

sharepoint 2010 怎样在Ribbon区加入功能button

2017-08-17 16:19 218 查看
继续前面的一篇博客,sharepoint 2010 怎样在列表中加入功能菜单操作项。这次主要是记录下,在Ribbon区域加入功能button。比如加入收藏button。例如以下图所看到的:



1。

还是一样。加入一个空元素,CollectionRibbonItem

改动XML文件代码,在<elements></elements>标签中。加入CustomAction,

<CustomAction

Id="Ribbon.Library.Actions.AddAButton"

Location="CommandUI.Ribbon"

RegistrationId="101"

RegistrationType="List"

Title="Add a Ribbon Button">

<CommandUIExtension>

<CommandUIDefinitions>

<CommandUIDefinition

Location="Ribbon.Library.Share.Controls._children">

<ButtonId="Ribbon.Library.Share.NewRibbonButton"

Command="NewRibbonButtonCommand"

Image16by16="/_layouts/15/2052/images/formatmap16x16.png"

Image32by32="/_layouts/15/2052/images/formatmap32x32.png"

LabelText="收藏"

TemplateAlias="o2" />

</CommandUIDefinition>

</CommandUIDefinitions>

<CommandUIHandlers>

<CommandUIHandler

Command="NewRibbonButtonCommand"

EnabledScript="javascript:SetEnableRibbonSubscribe();"

CommandAction="javascript:alert('Hello, world');" />

</CommandUIHandlers>

</CommandUIExtension>

</CustomAction>

2。

部署到站点上,就能够了。

參考资料:https://msdn.microsoft.com/zh-cn/library/ee537543.aspx

广州京微信息科技有限公司,.微软sharepoint解决方式提供商。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: