【问题标题】:Current List view in SharePoint 2013 custom actionSharePoint 2013 自定义操作中的当前列表视图
【发布时间】:2013-03-04 08:06:55
【问题描述】:

我正在尝试为 SharePoint (Office 365) 创建自定义列表操作,我需要获取当前列表视图。但是,如果我添加功能区操作,我在查找当前选定的列表视图时会遇到一些问题。我的试验:

a) 最好有一些具有当前视图 ID 的 url 令牌(如 {View}),但它看起来不存在。

b) 我想从源 url 中找到选定的视图,但是如果我将 Source={Source} 参数添加到自定义操作,我将 Source 解析为:Source=https://mysite.sharepoint.com/_layouts/15/commandui.ashx?ver=%2D1037522208&lcid=1033&qt=commandhandlers (虽然我希望像 https://mysite.sharepoint.com/_layouts/15/start.aspx#/Lists/My%20List/AllItems.aspx?InitialTabId=Ribbon%2EList&VisibilityContext=WSSTabPersistence 这样的东西)

c) .. ?

任何想法如何获取当前选定的列表视图?

【问题讨论】:

    标签: sharepoint-2013 sharepoint-clientobject


    【解决方案1】:

    似乎有不止一种方法可以为每个列表创建自定义操作。我的方法是删除 RegistrationType 和 RegistrationId:

    <CustomAction 
          Id="65695319-4784-478e-8dcd-4e541cb1d682.CustomAction"
          Location="CommandUI.Ribbon"
          Sequence="10001"
          Title="Invoke custom action">
    

    另一种方法是将自定义操作注册到内容类型 0x01:

    <CustomAction 
           Id="65695319-4784-478e-8dcd-4e541cb1d682.CustomAction" 
           Location="CommandUI.Ribbon"    
           RegistrationType="ContentType"
           RegistrationId="0x01"
           Sequence="10001" 
           Title="Invoke custom action">
    

    这样我得到了预期的结果

    【讨论】:

    • 这如何回答您的问题?我和你有同样的问题,这个答案对我没有帮助。有人只是想回答自己以获得一些分数还是什么?如何获取当前选中的视图 id?
    • 没问题。我不生你的气
    猜你喜欢
    • 2013-09-28
    • 2016-05-22
    • 2020-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-17
    • 2014-05-21
    相关资源
    最近更新 更多