Sharepoint学习笔记—Ribbon系列-- 6. 在Ribbon中删除指定控件(针对用户自定义Tab)
2012-03-20 05:39
323 查看
前面的几篇我们实现了添加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 开发工具将自动构建和部署功能。
转到网站或子网站中的文档库。查看结果如下图
下面 直接进入操作步骤
一、使用前面创建的那个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 开发工具将自动构建和部署功能。
转到网站或子网站中的文档库。查看结果如下图
相关文章推荐
- SharePoint【Ribbon系列】-- 06.在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系列-- 4. 在Ribbon中添加新Group(针对用户自定义Tab)
- SharePoint【Ribbon系列】-- 04.在Ribbon中添加新Group(针对用户自定义Tab)
- Sharepoint学习笔记—Ribbon系列-- 9.如何让用户定义的Ribbon引用外部Javascript文件
- CSS+HTML实例集合三,用户自定义创建表格并删除指定行、列,对表格中的数据进行排序,radio单选摁扭之调查问卷、之选择题
- Sharepoint学习笔记—Ribbon系列-- 在Ribbon中添加新Tab
- 鸡啄米vc++2010系列9(对话框控件的Tab顺序)
- 一步一步学Silverlight 2系列(10):使用用户控件
- android开源系列:CircleImageView自定义圆形控件的使用
- iOS开发系列之常用自定义控件开发集—自动广告墙图片控件开发
- SpringBoot系列之使用自定义注解校验用户是否登录
- 控件包含代码块(即 <% ... %>),因此无法修改控件集合(用户自定义控件中)
- Android基础知识之控件系列(1)——TextView及自定义动态TextView
- ASP.NET 用户控件自定义属性、方法、事件
- Sharepoint学习笔记—ECMAScript对象模型系列-- 11、 Enable/Disable Ribbon上的Button