sharepoint - SharePoint 扩展命令集
问题描述
SharePoint 现代:是否可以使用特定列表的命令集添加自定义操作或如何激活特定列表的自定义操作? 我正在尝试为特定列表开发自定义操作,但是当我在 SharePoint 租户中部署此自定义操作时,会为所有列表(相同类型的列表模板)添加此自定义操作。
解决方案
这是我将命令集扩展限制为特定列表的测试解决方案。
我们可以通过 获取当前列表标题this.context.pageContext.list.title
。
@override
public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void {
const compareOneCommand: Command = this.tryGetCommand('COMMAND_1');
if (compareOneCommand) {
// This command should be hidden unless exactly one row is selected.
compareOneCommand.visible = this.context.pageContext.list.title === 'MyList3';
}
}
推荐阅读
- c# - EF试图创建新条目而不是关系
- spring-boot - 仅使用一个 Bean 的 Spring 上下文测试
- python - Python Socket Closes after One Connection/Command
- angular - TypeError: p is not a function while calling map function in angular 4 for fetching series for bellcurve highchart
- angular - I can't generate a prod version in Ionic (AoT Failed)
- c# - 如何检索 TFS 文件用户已签出
- php - Parse application/x-httpd-php in php7 without file extention
- javascript - Chrome 存储响应未定义
- cumulocity - 如何使用@c8y/client 库
- android - 我可以在哪里向我的客户展示混合应用程序?