我已经用 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/