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

继续前面的一篇博客,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解决方式提供商。

posted @ 2017-08-17 16:19  brucemengbm  阅读(178)  评论(0编辑  收藏  举报