在 Sharepoint 2010 中添加更改项目订单功能区

发布于 2024-12-07 17:05:07 字数 1732 浏览 1 评论 0原文

我想将更改项目订单功能区添加到功能区面板中。我已经创建了功能并激活,但是我仍然看不到商品订单功能区。谁能帮我解决这个问题吗? 下面是我的代码

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!--Change Item order Ribbon-->
  <CustomAction
    Id="SPChangeItemOrder"
    Location="CommandUI.Ribbon.ListItem"
    RegistrationId="101"
    RegistrationType="List"
    Title="List View Ribbon Customization"
    >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <!--Get Details from CMDUI.XML-->
          <Button 
            Id="Ribbon.ListItem.Actions.ChangeItemOrder"
            Alt="Change the order of the items in this list."
            Sequence="20"
            Command="ChangeLinkOrder"
            LabelText="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
            TemplateAlias="o2"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
              />

        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler Command="ChangeLinkOrder" CommandAction="javascript:alert('Please check Change Item Order');"></CommandUIHandler>
      </CommandUIHandlers>

    </CommandUIExtension>
  </CustomAction>

I want to add Change item order ribbon into ribbon panel. I have created feature and activated, however i still cant see the item order ribbon. Can anyone help me with this?
below is my code

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!--Change Item order Ribbon-->
  <CustomAction
    Id="SPChangeItemOrder"
    Location="CommandUI.Ribbon.ListItem"
    RegistrationId="101"
    RegistrationType="List"
    Title="List View Ribbon Customization"
    >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <!--Get Details from CMDUI.XML-->
          <Button 
            Id="Ribbon.ListItem.Actions.ChangeItemOrder"
            Alt="Change the order of the items in this list."
            Sequence="20"
            Command="ChangeLinkOrder"
            LabelText="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
            TemplateAlias="o2"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
              />

        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler Command="ChangeLinkOrder" CommandAction="javascript:alert('Please check Change Item Order');"></CommandUIHandler>
      </CommandUIHandlers>

    </CommandUIExtension>
  </CustomAction>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

贩梦商人 2024-12-14 17:05:07

尝试类似的操作,其中 RegistrationID 是列表定义的 Type 值。如果您想使用 SharePoint 的 OOB 更改项目顺序命令,则不需要 CommandUIHandler。

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <!--Change Item order Ribbon-->
  <CustomAction
    Id="XYZ.Webpart.Links.XYZLinksListDefinition.RibbonSortOrderButton"
    Location="CommandUI.Ribbon"
    RegistrationId="30099"
    RegistrationType="List"
    Title="List View Ribbon Customization" >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
            Id="Ribbon.ListItem.Actions.RibbonSortOrderButton"
            Sequence="25"
            Command="ChangeLinkOrder"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
            LabelText="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Try something like this where RegistrationID is the Type value of a list definition. You don't need the CommandUIHandler if you want to use SharePoint's OOB Change Item Order command.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <!--Change Item order Ribbon-->
  <CustomAction
    Id="XYZ.Webpart.Links.XYZLinksListDefinition.RibbonSortOrderButton"
    Location="CommandUI.Ribbon"
    RegistrationId="30099"
    RegistrationType="List"
    Title="List View Ribbon Customization" >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
            Id="Ribbon.ListItem.Actions.RibbonSortOrderButton"
            Sequence="25"
            Command="ChangeLinkOrder"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
            LabelText="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
            ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
</Elements>
冷清清 2024-12-14 17:05:07

Customaction 元素中的属性位置值无效,请从此处选择正确的位置值 http:// msdn.microsoft.com/en-us/library/bb802730.aspx

Invalid value for attribute location in customaction element, choose right location value from here http://msdn.microsoft.com/en-us/library/bb802730.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文