首页 > 解决方案 > 使用 Kendo,如何通过单击按钮从多个 SharePoint 列表中删除 1 个项目?已经有 1 个工作,如何添加第二个 SharePoint 列表?

问题描述

我有在剑道网格上工作的 Destroy 方法。它成功地从 1 个 SharePoint 列表中删除了一个项目。但是,同一项目出现在我的应用程序的其他位置,因为它也在另一个 SharePoint 列表中。我也想从第二个列表中删除相同的项目,在这 1 次单击删除按钮上。

以下是当前适用于 1 个 SharePoint 列表的 kendo.transport.destroy 方法。如何添加第二个 SharePoint 列表?

            destroy: {
                url: function (options) {
                    console.log(options);
                    return _spPageContextInfo.webAbsoluteUrl +
                        "/_api/Web/Lists/GetByTitle('GalleryItems')/items(" + options.Id + ")"
                },
                cache: false,
                type: 'DELETE',
                dataType: 'json',
                headers: {
                    "X-RequestDigest": $('#__REQUESTDIGEST').val(),
                    'Accept': 'application/json; odata=verbose',
                    "If-Match": "*"
                },
                contentType: "application/json"
            }

//销毁列中的命令配置

{
                    command: ["edit",
                        {
                            name: "destroy",
                            text: "Delete",
                            class: "btn-delete"
                        }],
                    title: " "
                }],

标签: jquerysharepointkendo-uikendo-gridcrud

解决方案


推荐阅读