如何在sharepoint 2010中使用CustomAction添加功能区项?
如何在sharepoint 2010中使用CustomAction添加功能区项目我真的推荐这个博客系列:以下是使用sharepoint 2010中的CustomAction将名为“测试操作1”的功能区项目(按钮)添加到TemplateType=10003的列表中的步骤 1.添加新元素并添加以下代码。请注意,有两个自定义操作。一个用于添加功能区按钮,另一个用于添加javascript文件 注册ID与ListTemplateType相同 有关默认服务器功能区自定义位置的列表,请参见 请参见示例项目结构如何在sharepoint 2010中使用CustomAction添加功能区项?,sharepoint,Sharepoint,如何在sharepoint 2010中使用CustomAction添加功能区项目我真的推荐这个博客系列:以下是使用sharepoint 2010中的CustomAction将名为“测试操作1”的功能区项目(按钮)添加到TemplateType=10003的列表中的步骤 1.添加新元素并添加以下代码。请注意,有两个自定义操作。一个用于添加功能区按钮,另一个用于添加javascript文件 注册ID与ListTemplateType相同 有关默认服务器功能区自定义位置的列表,请参见 请参见示例项目结
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction ShowInLists="TRUE" Id="TestAction1" RegistrationType="List" RegistrationId="10003" Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button Id="Ribbon.ListItem.Actions.TestAction1" Alt="Test Action 1" Sequence="10" Image32by32="/_layouts/images/ACTIONSEDITPAGE.PNG" Command="Test_Action1" LabelText="Test Action 1" TemplateAlias="o2"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="Test_Action1" CommandAction="javascript:TestAction1();" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="Test.Ribbon.TestScript" Location="ScriptLink" ScriptSrc="~/_layouts/SPTest/TestJScript1.js" />
</Elements>
function TestAction1() {
alert("This the test action 1");
}