javascript - 使用 ng-grid 单元格值中的值在 SharePoint 模式中打开链接

标签 javascript angularjs sharepoint ng-grid

我已经用 SharePoint 项目填充了 ng-grid,我想在单击每行末尾的编辑按钮后在 SharePoint 模式中打开 SharePoint 编辑表单。 我只能在没有 OpenPopUpPage 的情况下完成这项工作。当我使用 OpenPopUpPage 时,{{row.entity.Id}} 不会更改为行 Id,因此会导致编辑页面损坏。

作品:

{ displayName: 'Edit', cellTemplate: '<a ng-href="../lists/locations/editform.aspx?IsDlg=1&id={{row.entity.Id}}">Edit</a>' }

打开模式,但编辑表单损坏(ID 不正确):

{ displayName: 'Edit', cellTemplate: '<a ng-href="#" onclick="javascript:OpenPopUpPage(\'../lists/locations/editform.aspx?IsDlg=1&id={{row.entity.Id}}\')">Edit</a>' }

最佳答案

我对共享点弹出窗口一无所知,但要将值传递给函数,您应该使用以下代码:

    $scope.gridOptions = {
    data: 'myData',
    columnDefs: [{
      field: 'name',
      displayName: 'Name'
    }, {
      field: 'id',
      displayName: 'Action',
      cellTemplate: '<a ng-click="popup(row.entity.id)" href="#">Edit</a>'
    }]
    };

    $scope.popup = function(id) {
    // call your popup from here
    alert(id);
    }

试试这个 Plunker

关于javascript - 使用 ng-grid 单元格值中的值在 SharePoint 模式中打开链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23611239/

相关文章:

html - XSLT 将目标 ="_blank"添加到 URL

sharepoint - 通过 FTP 将文件上传到 Sharepoint 文档库

javascript - 如何将数据从一个页面传递到另一个html

javascript - Mocha 导入外部脚本失败

javascript - Angularjs:无法解析带单引号的 JSON

android - Ionic 在 iOS 版本 8 上出现闪屏后崩溃

javascript - 使用 CloudCode 在 Parse.com 中保存来自 URL 的图像

javascript - 获取JSON IP + 国家代码

javascript - Angular 属性指令 - 在当前指令下方添加 ng-repeat

swift - 如何在 Swift 中使用 Msgraph 访问共享点列表