Is there a way to combine two fields into one field in angular ui grid?
I tried the below code, the case manager part worked but the client part is not working
CaseServices.getCases().then(function (response) {
$scope.gridOptions.columnDefs = [
{ name:'Title', field: 'Title' },
{ name:'Case Manager', field: 'Case_x0020_Manager.Title' },
{ name:'Client', field: 'Client.FirstName' + 'Client.Title'},
],
$scope.gridOptions.data = response.d.results;
});
I saw in an example that we can build our own functions like below
columnDefs: [
{ name:'firstName', field: 'first-name' },
{ name:'1stFriend', field: 'friends[0]' },
{ name:'city', field: 'address.city'},
{ name:'getZip', field: 'getZip()', enableCellEdit:false}
],
data : [ {
"first-name": "Cox",
"friends": ["friend0"],
"address": {street:"301 Dove Ave", city:"Laurel", zip:"39565"},
"getZip" : function() {return this.address.zip;}
}
]
But since I am getting response from ajax call, I am not sure how to modify the data part ($scope.gridOptions.data = response.d.results;)
Can someone help on any one of these? as it will solve the purpose