AngularJS ui-grid: 如何 select 将数据中的属性集显示在表格中

AngularJS ui-grid: how to select the the set of attributes in a Data to display in tabe

我正在尝试使用 ui-grid 来显示来自 ajax 调用的数据。 从调用返回的数据有很多属性。但我需要在 ui 网格中显示特定属性。怎么做。

例如ajax在属性

下调用return
  var resp = {
"Status":true,
"Msg":"",
"SendTran":[{
"Document_Gid":"XXXX",
"DocumentId":"XXX",
"DocumentType_Name": "XXX",
"Created_Date":"XXXX",
"Verification_Status":"XXX"
}]
};

resp 是 ajax return 值。这有多个属性,我们只需要 SendTran 属性来绑定网格。

var data = [];
$scope.sendtranscripts = {
        paginationPageSizes: [10, 25, 50, 75],
        paginationPageSize: 20,
        showGridFooter: true,
        showColumnFooter: true,
        enableFiltering: true,
        enableGridMenu: true,
        enableRowSelection: true,
        enableSelectAll: false,
        selectionRowHeaderWidth: 35,

        columnDefs: [         
            {
                field: 'DocumentId', width: '20%', displayName: 'Document ID', cellTooltip: true, headerTooltip: true
            },
            {
                field: 'DocumentType_Name', width: '40%', displayName: 'Document Name'
            },
            {
                field: 'Verification_Status', width: '20%', displayName: 'Document Status'
            },
            {
                field: 'Created_Date', width: '20%', displayName: 'Created Date'
            }

        ],
        data: data
};
$scope.sendtranscripts.data = resp.data.SendTran;