一般情况下对IT管理者来说,在SharePointFarm中维护Feature,更喜欢使用命令行实现,这样可以省去登录到具体站点的操作。比如IT接到enduser的一个需求,要开启SiteCollectionFeature,如果直接操作......
2023-01-12
在做知识库文档管理模块中,有一个需求,就是想要在自定义列表当中,增加一个,我的收藏功能。按照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&ListId={ListId}&Itemid={ItemId}&CollectionType=CustomList'}"/>
</CustomAction>
2。部署下project,我们会看到,所有的sharepoint custom list,都会有“我的收藏”这个菜单项。点击我的收藏,会提交一条数据到收藏记录表。
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
|
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:
|
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. |
相关文章
一般情况下对IT管理者来说,在SharePointFarm中维护Feature,更喜欢使用命令行实现,这样可以省去登录到具体站点的操作。比如IT接到enduser的一个需求,要开启SiteCollectionFeature,如果直接操作......
2023-01-12
我们经常会在SharePoint网站集的权限列表中看到某个user有LimitedAccessPermission,但是我们都知道或者试过,在SharePointsitecollection中没有办法直接添加user赋予LimitedAccess权限,并且LimitedAccess这个......
2023-01-12
在这样的场景下,比如统计员工的个人信息,IT会在SharePoint中新建list,加一些需要填写的栏位,然后让公司员工登录填写。这时候比起大家都能看到彼此信息而言,从公司角度更想让员工只能......
2023-01-12
大多数企业使用SharePoint文档库时,都会建议EndUser在编辑文档前先做CheckOut动作,这样可以保证文档在当前用户编辑过程中,其他人只能view而不能edit,防止多人同时修改同一文件互相影响的......
2023-01-12
为了记录SharePointLibrary/List中file/Item的修改情况,ITAdministrator会在List/Library的VersionSettings中开启Version管控设置。之后用户每次编辑item/file保存就会生成一个新的version记录,这样我们就会知道......
2023-01-12