SharePoint【Ribbon系列】-- 06.在Ribbon中删除指定控件(针对用户自定义Tab)
2013-02-20 20:08
281 查看
前面的几篇我们实现了添加Tab,添加Group,添加Button,完成的都是“增”操作,这里我们准备删除Ribbon上的某个Button控件。需要说明的是,这里的删除其实是通过隐藏(Hidde)来实现的。
下面 直接进入操作步骤
一、使用前面创建的那个Sharepoint项目
然后在此项目中添加新的空白Element如下图
二、定义此Element项的内容实现删除功能
方法是 打开 RemoveRibbonButton下的Elements.xml 文件,其内容如下:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Ribbon.CustomTabExample.CutomImgGroup.RemoveRibbonButton"
Location="CommandUI.Ribbon"
RegistrationId="101"
RegistrationType="List">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
</Elements>
本例我们确定所要删除的Button的位置就是Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello(格式是: [Ribbon].[Tab].[目标Group的名字].[目标控件的名字]),所以此处,Location就是:Location="Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello"
三、部署自定义Group项
按 F5。Visual Studio 2010 中的 SharePoint 开发工具将自动构建和部署功能。
转到网站或子网站中的文档库。查看结果如下图
转载:/article/4844627.html
下面 直接进入操作步骤
一、使用前面创建的那个Sharepoint项目
然后在此项目中添加新的空白Element如下图
二、定义此Element项的内容实现删除功能
方法是 打开 RemoveRibbonButton下的Elements.xml 文件,其内容如下:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Ribbon.CustomTabExample.CutomImgGroup.RemoveRibbonButton"
Location="CommandUI.Ribbon"
RegistrationId="101"
RegistrationType="List">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
</Elements>
本例我们确定所要删除的Button的位置就是Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello(格式是: [Ribbon].[Tab].[目标Group的名字].[目标控件的名字]),所以此处,Location就是:Location="Ribbon.CustomTabExample.CutomImgGroup.CustomImgGroupHello"
三、部署自定义Group项
按 F5。Visual Studio 2010 中的 SharePoint 开发工具将自动构建和部署功能。
转到网站或子网站中的文档库。查看结果如下图
转载:/article/4844627.html
相关文章推荐
- Sharepoint学习笔记—Ribbon系列-- 6. 在Ribbon中删除指定控件(针对用户自定义Tab)
- Sharepoint学习笔记—Ribbon系列-- 7. 在Ribbon中替换指定控件(针对用户自定义Tab)
- SharePoint【Ribbon系列】-- 07.在Ribbon中替换指定控件(针对用户自定义Tab)
- Sharepoint学习笔记—Ribbon系列-- 5. 在Ribbon中添加新控件(针对用户自定义Tab)
- SharePoint【Ribbon系列】-- 05.在Ribbon中添加新控件(针对用户自定义Tab)
- Sharepoint进修笔记—Ribbon系列-- 4. 在Ribbon中添加新Group(针对用户自定义Tab)
- SharePoint【Ribbon系列】-- 04.在Ribbon中添加新Group(针对用户自定义Tab)
- Sharepoint学习笔记—Ribbon系列-- 4. 在Ribbon中添加新Group(针对用户自定义Tab)
- SharePoint 2010 自定义页面出现“项目可能已被其他用户删除或重命名”问题跟踪
- 在SharePoint 2010 母版页里添加自定义用户控件
- SharePoint【Ribbon系列】-- 02.在Ribbon中添加新Tab
- sharepoint 2016 学习系列篇(14)-自定义列表应用篇-(3)列表数据的新增,修改,删除操作
- SharePoint【Ribbon系列】-- Sharepoint 2010 根据用户权限隐藏Ribbon菜单
- CSS+HTML实例集合三,用户自定义创建表格并删除指定行、列,对表格中的数据进行排序,radio单选摁扭之调查问卷、之选择题
- SharePoint【Ribbon系列】-- 09.如何让用户定义的Ribbon引用外部Javascript文件
- 很犀利的防止自定义的用户控件闪烁方法
- 如何在aspx网页中使用.net编译后的自定义用户控件
- 大量的使用用户自定义控件对web性能有什么影响?
- 使用委托在用户自定义控件中实现事件响应
- Win8 自定义TimePicker --- 用户控件