在Sharepoint Designer中设置CustomAction

关于在SharepointDesigner中设置CustomAction的备 忘,没有啥逻辑性,只是一些知识点。
下面是用SPD的一些限制
  • SPD中只能针对某List设置Custom Action,无法实现一次性为多个List或某一类List批量设置。
  • 无法在Site Actions, SiteSetting等其他地方设置CustomAction。
  • 无法实现根据当前是否有Items处于选择状态或其他因素启用或禁用CustomAction。
  • ...
虽然有很多缺点,但是不需要编码,还是有很多用武之地的。
 
可以在以下5个地方添加Custom Action:
1. List Item Menu (LIM) 
2. Display Form Ribbon 
3. Edit Form Ribbon 
4. New Form Ribbon 
5. View Ribbon 
 
有以下三种CustomAction:
1. Navigate to Form
2. Initiate Workflow
3. Navigate to URL,可以在里面加入javascript,需要注意的是 如果在你输入的URL中如果包含某个Workflow的名字,就会被SPD自动替换成Initiate workflow这种Action,我就遇到过这种情况,被折腾得很惨。
 
 
在CustomAction中可以使用一些token,如下表:
TokenDescription
~siteThe current website (relative link)
~sitecollectionThe current site collection (relative link)
{ItemId}The (GUID) ID of a list item
{ItemUrl}The URL of a list item
{ListId}The ID of a list
{SiteUrl}The URL of the site (Web) within a site collection
{Source}Fully qualified request URL
{SelectedListId}" src="/CuteSoft_Client/CuteEditor/Images/anchor.gif">The (GUID) ID of the list that is currently selected from a list view
{SelectedItemId}" src="/CuteSoft_Client/CuteEditor/Images/anchor.gif">The (GUID) ID of the item that is currently selected from the list view
 
You can find further information on using tokens in SharePoint at

在Dialog中启动CustomAction
javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/Lists/CustomList/DispForm.aspx?ID={ItemId}", title: "Custom Form"}); return false;
 
CMDUI.xml,这里面有系统内 置的Action的配置,是很好的参考资源
%SystemDrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.xml
 

Location ID
下表是默认的location,全部的LocationID,请参考: http://msdn.microsoft.com/en-us/library/ee537543.aspx
Ribbon LocationList or LibraryRibbon Control and Group ID
Display FormListRibbon.ListForm.Display.Manage.Controls._children
 LibraryRibbon.ListForm.Display.Actions.Controls._children
Edit FormListRibbon.ListForm.Edit.Actions.Controls._children
 LibraryRibbon.DocLibListForm.Edit.Actions.Controls._children
New FormListRibbon.ListForm.Edit.Actions.Controls._children
 Library[*]Ribbon.DocLibListForm.New.Actions.Controls._children
View FormListRibbon.ListItem.Actions.Controls._children
 LibraryRibbon.Documents.Manage.Controls._children
Quick StepListRibbon.ListItem.QuickSteps.Controls._children
 LibraryRibbon.Documents.QuickSteps.Controls._children
Rights Mask
 
sequence number 
0 代表在最前,可以在CMDUI.xml中得到内置Action的序列号
 
-------------------------------------------------------------
其他有用的link:

转载于:https://www.cnblogs.com/Little-Li/archive/2011/10/21/2220708.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值