zoukankan      html  css  js  c++  java
  • sharepoint ribbon添加菜单

        <CustomAction
          Id="Ribbon.WebPartPage.CustomGroup"
          Location="CommandUI.Ribbon">        
            <CommandUIExtension>
                <CommandUIDefinitions>
                    <CommandUIDefinition
                      Location="Ribbon.WebPartPage.Groups._children">
                        <Group
                          Id="Ribbon.WebPartPage.CustomGroup"
                          Sequence="55"
                          Description="des"
                          Title="custom group"          
                           Command="CustomGroup"
                          Template="Ribbon.Templates.Flexible2">
                            
                            <Controls Id="Ribbon.WebPartPage.CustomGroup.Controls">
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupTemplate"
                                  Command="CustomGroupSelectTemplate"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="选择模版"                               
                                  TemplateAlias="o2"
                                  Sequence="15" />
                                
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupSkin"
                                  Command="CustomGroupSelectSkin"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="选择皮肤"
                                  TemplateAlias="o2"
                                  Sequence="18" />
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupCMS"
                                  Command="CustomGroupCMS"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="内容管理"
                                  TemplateAlias="o2"
                                  Sequence="21" />
                            </Controls>
                        </Group>
                    </CommandUIDefinition>
                    <CommandUIDefinition
                      Location="Ribbon.WebPartPage.Scaling._children">
                        <MaxSize
                          Id="Ribbon.WebPartPage.Scaling.CustomGroup.MaxSize"
                          Sequence="15"
                          GroupId="Ribbon.WebPartPage.CustomGroup"
                          Size="LargeLarge" />
                    </CommandUIDefinition>
                </CommandUIDefinitions>
                <CommandUIHandlers>
                    <CommandUIHandler
                      Command="CustomGroup"
                      CommandAction="javascript:return true;" />
                    <CommandUIHandler
                      Command="CustomGroupSelectTemplate"
                      CommandAction="javascript:alert('Hello, world!');" />
                    <CommandUIHandler
                      Command="CustomGroupSelectSkin"
                      CommandAction="javascript:alert('Good-bye, world!');" />
                    <CommandUIHandler
                      Command="CustomGroupCMS"
                      CommandAction="javascript:alert('cms, world!');" />
                </CommandUIHandlers>
            </CommandUIExtension>
        </CustomAction>

    1、此按钮添加到“页面” tab页;

    2、需要编辑页面才能看到效果;

    3、javascript执行不来,不知道怎么回事;

    最后改用urlaction

        <CustomAction
      Id="SelectTemplate"
      GroupId="SiteActions"
      Location="Microsoft.SharePoint.StandardMenu"
      Sequence="1000"
       Title="自定义" Description=描述"
      ImageUrl="/_layouts/images/visualupgradehh.png"
       Rights="ManagePermissions">
            <UrlAction Url="~site/_layouts/settings.aspx"/>
        </CustomAction>
  • 相关阅读:
    SQL 执行进展优化
    初识SQL 执行顺序
    前端模块化开发的价值(转)
    js 闭包之一
    js模块开发(一)
    简单说说call 与apply
    js 爱恨情仇说 this
    说说 js String
    $Ajax简单理解
    SQL-如何使用 MongoDB和PyMongo。
  • 原文地址:https://www.cnblogs.com/denglinhai/p/2662735.html
Copyright © 2011-2022 走看看