【问题标题】:How to retrive an item ID from Sharepoint when user clicks on the item in the List?当用户单击列表中的项目时,如何从 Sharepoint 中检索项目 ID?
【发布时间】:2019-09-28 13:15:29
【问题描述】:

我有一个包含许多项目的 SharePoint 列表。如何找出用户点击了哪个项目?我需要将该值传递给 getItemByID() 以便我可以访问表单中的数据。我也在尝试在 Page_load 方法中这样做。

【问题讨论】:

  • 您的意思是开箱即用列表,还是您有任何用于列表项显示的自定义页面?
  • 这是一种混合解决方案。页面是OOB,视图是OOB,但表单是自定义的。

标签: c# .net sharepoint sharepoint-2016


【解决方案1】:

试试getSelectedItems

var items = SP.ListOperation.Selection.getSelectedItems(ctx);

            if (items.length > 0) {
                var itemids = [];
                for (i = 0; i < items.length; i++) {
                    itemids.push(items[i].id);
                }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-15
    • 1970-01-01
    • 1970-01-01
    • 2014-10-03
    • 1970-01-01
    • 2017-07-21
    • 1970-01-01
    相关资源
    最近更新 更多