我已经用SharePoint项目填充了一个ng-grid,我想在单击每行末尾的编辑按钮后在SharePoint模式中打开SharePoint编辑表单。我只能使这个工作没有openpopupage。当我使用openpopupage的{{row.entity。Id}}不会更改为行Id,因此会导致编辑页损坏。
:
{ displayName: 'Edit', cellTemplate: '<a ng-href="../lists/locations/editform.aspx?IsDlg=1&id={{row.entity.Id}}">Edit</a>' }
打开模式,但带有破碎的editform(不正确的id):
{ displayName: 'Edit', cellTemplate: '<a ng-href="#" onclick="javascript:OpenPopUpPage('../lists/locations/editform.aspx?IsDlg=1&id={{row.entity.Id}}')">Edit</a>' }
我不知道任何关于sharepoint弹出窗口,但传递一个值给一个函数,你应该使用这段代码:
$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);
}
Try this Plunker