1

我是 SharePoint 功能区的新手。为什么在我的选项卡组中看不到ViewEdit按钮Manage

以下是我的定义供您参考:

<ContextualGroup Id="Ribbon.MyWorkContextualTabGroup"
  Color="Blue" Title="{title}" 
  Command="MyWorkContextualTab.EnableContextualGroup" 
  Sequence="502" 
  ContextualGroupId="MyWorkContextualTabGroup">
  <Tab Id="Ribbon.MyWorkTab" 
       Title="My Work" 
       Description="My Work tab description" 
       Command="MyWorkContextualTab.EnableMyWorkTab" 
       Sequence="501">
    <Scaling Id="Ribbon.MyWorkTab.Scaling">
      <MaxSize Id="Ribbon.MyWorkTab.MaxSize_New"
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_New"
               Size="MyWorkLayout"
               Sequence="10"/>

      <MaxSize Id="Ribbon.MyWorkTab.MaxSize_Manage"
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage"
               Size="MyWorkLayout"
               Sequence="20" />

      <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_New"
             GroupId="Ribbon.MyWorkTab.MyWorkGroup_New"
             Size="MyWorkLayout"
             Sequence="30" />

      <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_Manage"
             GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage"
             Size="MyWorkLayout"
             Sequence="40"/>
    </Scaling>
    <Groups Id="Ribbon.MyWorkTab.Groups">
      <Group Id="Ribbon.MyWorkTab.MyWorkGroup_New" 
             Description="New group description" 
             Title="New" 
             Command="MyWorkContextualTab.EnableMyWorkGroup_New" 
             Sequence="52" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroup_New.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_New.NewItem" 
                  Command="MyWorkContextualTab.NewItemCommand" 
                  Sequence="15" 
                  Description="Add a new item" 
                  LabelText="New Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/newitem.png" />
        </Controls>
      </Group>
      <Group Id="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
             Description="Manage group description" 
             Title="Manage" 
             Command="MyWorkContextualTab.EnableMyWorkGroup_Manage" 
             Sequence="53" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.ViewItem" 
                  Command="MyWorkContextualTab.ViewItemCommand" 
                  Sequence="25" 
                  Description="View this item" 
                  LabelText="View Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/viewitem.png" />
          <Button Id="Ribbon.MyWorkTab.MyWorkGroup_Manage.EditItem" 
                  Command="MyWorkContextualTab.EditItemCommand" 
                  Sequence="35"
                  Description="Edit this item" 
                  LabelText="Edit Item" 
                  TemplateAlias="ONE_R1" 
                  Image32by32="_layouts/images/mywork/ribbon/edititem.png" />
        </Controls>
      </Group>
    </Groups>
  </Tab>
</ContextualGroup>


<GroupTemplate Id="Ribbon.Templates.MyWorkTemplate">
  <Layout Title="MyWorkLayout" LayoutTitle="MyWorkLayout">
    <Section Alignment="Top" Type="OneRow">
      <Row>
        <ControlRef DisplayMode="Large" TemplateAlias="ONE_R1"/>
      </Row>
    </Section>
    <Section Alignment="Top" Type="ThreeRow">
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R1"/>
      </Row>
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R2"/>
      </Row>
      <Row>
        <ControlRef DisplayMode="Medium" TemplateAlias="THE_R3"/>
      </Row>
    </Section>
  </Layout>
</GroupTemplate>
4

2 回答 2

2

我使用 Sharepoint 的 Ribbon 的次数不多,但据我了解,它几乎与 CRM 2011 的 Ribbon 结构相同。当 CRM 中出现缺少按钮的问题时,通常是 Scaling 和 MaxSize 的顺序问题。

就顺序而言,所有 MaxSize 元素都需要位于 Scale 元素之前。我会尝试将序列号添加到缩放部分中的 MaxSize/Scale 元素并调整数字以确保 maxsize 出现在缩放之前。

希望这可以帮助。

例子:

<Scaling Id="Ribbon.MyWorkTab.Scaling">      
         <MaxSize Id="Ribbon.MyWorkTab.MaxSize_New" 
                  GroupId="Ribbon.MyWorkTab.MyWorkGroup_New" 
                  Size="MyWorkLayout" 
                  Sequence="10"/>

         <MaxSize Id="Ribbon.MyWorkTab.MaxSize_Manage" 
                  GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
                  Size="MyWorkLayout" 
                  Sequence="20" />  

        <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_New" 
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_New" 
               Size="MyWorkLayout" 
               Sequence="30" /> 

        <Scale Id="Ribbon.MyWorkTab.Scalling.MyWorkTabScalling_Manage" 
               GroupId="Ribbon.MyWorkTab.MyWorkGroup_Manage" 
               Size="MyWorkLayout" 
               Sequence="40"/> 
</Scaling>
于 2011-06-17T19:10:37.400 回答
1

好的,这就是我必须做的:

  1. 不要_ (underscore)在 Id 中使用。
  2. 更改我的布局以使用OverflowSection

如果您需要,这是我的最终定义:

<ContextualGroup Id="Ribbon.MyWorkContextualTabGroup"
  Color="Blue" Title="{title}" 
  Command="MyWorkContextualTab.EnableContextualGroup" 
  Sequence="502" 
  ContextualGroupId="MyWorkContextualTabGroup">
  <Tab Id="Ribbon.MyWorkTab" 
       Title="My Work" 
       Description="My Work tab description" 
       Command="MyWorkContextualTab.EnableMyWorkTab" 
       Sequence="501">
    <Scaling Id="Ribbon.MyWorkTab.Scaling">
      <MaxSize Id="Ribbon.MyWorkTab.MaxSizeNew"
               GroupId="Ribbon.MyWorkTab.MyWorkGroupNew"
               Size="MyWorkLayout"
               Sequence="10"/>

      <MaxSize Id="Ribbon.MyWorkTab.MaxSizeManage"
               GroupId="Ribbon.MyWorkTab.MyWorkGroupManage"
               Size="MyWorkLayout"
               Sequence="20" />

      <Scale Id="Ribbon.MyWorkTab.Scaling.MyWorkTabScalingNew"
             GroupId="Ribbon.MyWorkTab.MyWorkGroupNew"
             Size="MyWorkLayout"
             Sequence="30" />

      <Scale Id="Ribbon.MyWorkTab.Scaling.MyWorkTabScalingManage"
             GroupId="Ribbon.MyWorkTab.MyWorkGroupManage"
             Size="MyWorkLayout"
             Sequence="40"/>
    </Scaling>
    <Groups Id="Ribbon.MyWorkTab.Groups">
      <Group Id="Ribbon.MyWorkTab.MyWorkGroupNew" 
             Description="New group description" 
             Title="New" 
             Command="MyWorkContextualTab.EnableMyWorkGroupNew" 
             Sequence="52" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroupNew.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupNew.NewItem" 
                  Command="MyWorkContextualTab.NewItemCommand" 
                  Sequence="15" 
                  Description="Add a new item" 
                  LabelText="New Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/newitem-32.png" />
        </Controls>
      </Group>
      <Group Id="Ribbon.MyWorkTab.MyWorkGroupManage" 
             Description="Manage group description" 
             Title="Manage" 
             Command="MyWorkContextualTab.EnableMyWorkGroupManage" 
             Sequence="53" 
             Template="Ribbon.Templates.MyWorkTemplate">
        <Controls Id="Ribbon.MyWorkTab.MyWorkGroupManage.Controls">
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupManage.ViewItem" 
                  Command="MyWorkContextualTab.ViewItemCommand" 
                  Sequence="25" 
                  Description="View this item" 
                  LabelText="View Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/viewitem-32.png" />
          <Button Id="Ribbon.MyWorkTab.MyWorkGroupManage.EditItem" 
                  Command="MyWorkContextualTab.EditItemCommand" 
                  Sequence="35"
                  Description="Edit this item" 
                  LabelText="Edit Item" 
                  TemplateAlias="ONERW" 
                  Image32by32="_layouts/images/mywork/ribbon/edititem-32.png" />
        </Controls>
      </Group>
    </Groups>
  </Tab>
</ContextualGroup>


<GroupTemplate Id="Ribbon.Templates.MyWorkTemplate">
  <Layout Title="MyWorkLayout" LayoutTitle="MyWorkLayout">
    <OverflowSection Type="OneRow" DisplayMode="Large" TemplateAlias="ONERW"/>
  </Layout>
</GroupTemplate>
于 2011-06-17T22:16:38.810 回答