欧非资源网:安全、免费、专业放心的资源下载站! 最新软件|软件分类

您的位置:欧非资源网 > 其他专区 > SharePoint > sharepoint 如何在列表中添加功能菜单操作项

sharepoint 如何在列表中添加功能菜单操作项

时间:2020-09-04 00:03作者:admin来源:未知人气:339我要评论(0)

在做知识库文档管理模块中,有一个需求,就是想要在自定义列表当中,增加一个,我的收藏功能。按照sharepoint默认的列表来做,我们可以在列表的标题字段中,增加一个功能菜单项,叫我的收藏.如下图。

sharepoint 如何在列表中添加功能菜单操作项
 

点击收藏,弹出一个提示框,点击确定,我们把这个纪录添加到收藏记录表。

sharepoint 如何在列表中添加功能菜单操作项
 

还是沿用前面的一个sharepoint project ,sharepoint 2010 如何扩展webpart自定义属性边栏字段 custom webpart properties ,在其基础上,来做这个功能。

1。添加一个空元素,CollectionMenuItem。在这个空元素里面,添加一个CustomAction属性

<CustomAction
    Id="CollectionMenuItem"
    RegistrationType="List"
    RegistrationId="100"
    Location="EditControlBlock"
    Sequence="301"
    Title="我的收藏"
    ImageUrl="/_layouts/images/ReportServer/editreport.gif">
    <UrlAction Url="javascript:if(confirm('确认要收藏吗?')==false){ return false;}
               else{window.location.href='/_layouts/WebpartBarTest/CollectionEdit.aspx?scope=item&amp;ListId={ListId}&amp;Itemid={ItemId}&amp;CollectionType=CustomList'}"/>
 
  </CustomAction>

2。部署下project,我们会看到,所有的sharepoint custom list,都会有“我的收藏”这个菜单项。点击我的收藏,会提交一条数据到收藏记录表。

SharePoint 2010 List Template Type Registration IDs

 SharePoint RegistrationID's

Sl .No
Name
Registration ID
1
NoListTemplate
0
2
GenericList
100
3
DocumentLibrary
101
4
Survey
102
5
Links
103
6
Announcements
104
7
Contacts
105
8
Events
106
9
Tasks
107
10
DiscussionBoard
108
11
PictureLibrary
109
12
DataSources
110
13
WebTemplateCatalog
111
14
UserInformation
112
15
WebPartCatalog
113
16
ListTemplateCatalog
114
17
XMLForm
115
18
MasterPageCatalog
116
19
NoCodeWorkflows
117
20
WorkflowProcess
118
21
WebPageLibrary
119
22
CustomGrid
120
23
SolutionCatalog
121
24
NoCodePublic
122
25
ThemeCatalog
123
26
DataConnectionLibrary
130
27
WorkflowHistory
140
28
GanttTasks
150
29
Meetings
200
30
Agenda
201
31
MeetingUser
202
32
Decision
204
33
MeetingObjective
207
34
TextBox
210
35
ThingsToBring
211
36
HomePageLibrary
212
37
Posts
301
38
Comments
302
39
Categories
303
40
Facility
402
41
Whereabouts
403
42
CallTrack
404
43
Circulation
405
44
Timecard
420
45
Holidays
421
46
IMEDic
499
47
ExternalList
600
48
IssueTracking
1100
49
AdminTasks
1200
50
HealthRules
1220
51
HealthReports
1221
52
InvalidType
-1
1
NoListTemplate
0
 
url 参数代表的值:http://msdn.microsoft.com/en-us/library/ff458385.aspx

Attribute

Description

Command

Required. The name of a command. The value of this attribute matches the value of aCommand attribute on an element that defines a control.

CommandAction

Required. A script statement to execute when this handler is invoked. Microsoft SharePoint Foundation calls theeval method, passing in the value of this attribute.

The value of the attribute can contain substitution tokens that are transformed at rendering. The following tokens are recognized:

  • {ItemId} – ID (GUID) taken from the list view.

  • {ItemUrl} – Web-relative URL of the list item (Url).

  • {RecurrenceId} – ID of a recurrent item (RecurrenceID).

  • {SiteUrl} – The fully qualified URL to the site (Url).

  • {ListId} – ID (GUID) of the list (ID).

  • {ListUrlDir} – Server-relative URL of the site plus the list's folder.

  • {Source} – Fully qualified request URL.

  • {SelectedListId} – ID (GUID) of the list that is currently selected from a list view.

  • {SelectedItemId} – ID of the item that is currently selected from the list view.

EnabledScript

Optional. A script statement that is executed to determine whether the command is enabled or disabled. The script expression should return aBoolean value,true if the command is enabled andfalse if not. If the ribbon is disabled, commands are grayed out and are not clickable.

As with the CommandAction attribute, theeval method is called with the value of this attribute as an argument. TheEnabledScript attribute does not support the substitution tokens that are described for theCommandAction attribute.

相关阅读 SharePoint中Office文件无法打开的解决方案如何快速生成SharePoint测试大文件如何查询SharePoint Library中空文件夹?如何快速备份SharePoint Farm Solution如何解决Event Viewer中SharePoint Error - Event ID 8321SharePoint 2016 CU安装失败,"Exception: The upgraded database schema doesn't match the TargetSchema"的解决方案InfoPath Error “此文档库已经被重命名或删除,或者网络问题导致文件无法保存…” 的解决方案SharePoint 2013 App概述How to Shrink SharePoint Content Database Log File?Project Web App Feature无法开启的解决方案

文章评论
发表评论

热门文章 SharePoint 2016 图文安装教程 后面有激活序列号、密钥分享[SharePoint入门教程]一SharePoint发展、工具及术语如何用 SharePoint Online创建团队网站?SharePoint Iframe 报错“此内容不能显示在一个框架中”

最新文章 SharePoint中Office文件无法打开的解决方案如何快速生成SharePoint测试大文件 如何查询SharePoint Library中空文件夹?如何快速备份SharePoint Farm Solution如何解决Event Viewer中SharePoint Error - Event ID 8321SharePoint 2016 CU安装失败,"Exception: The upgraded database s

人气排行 SharePoint 2016 图文安装教程 后面有激活序列号、密钥分享[SharePoint入门教程]一SharePoint发展、工具及术语如何用 SharePoint Online创建团队网站?SharePoint Iframe 报错“此内容不能显示在一个框架中”SharePoint 2013 安装图解 SharePoint安装步骤图解教程SharePoint 如何开启访问请求[SharePoint入门教程]一SharePoint概述[SharePoint入门教程]一创建SharePoint母版页

盖楼回复X

(您的评论需要经过审核才能显示)