i get columnNames
dynamically with object inside of an property,i just want to show only that property which is inside of that object.
this is my columnNames
$scope.columnNames=[
{"field":"firstName"},
{"field":"lastName"},
{"field":"id"},//i can get "id" or "name" or anything it comes dynamically
{"field":"employed"}
];
and i get the data like this
$scope.gridOptions.data = [
{
"firstName": "Cox",
"lastName": "Carney",
"id": "{'id':'1','name':'Syed'}",
"employed": true
},
{
"firstName": "Lorraine",
"lastName": "Wise",
"id": "{'id':'2','name':'Rasheed'}",
"employed": false
},
{
"firstName": "Nancy",
"lastName": "Waters",
"id": "{'id':'3','name':'Emir'}",
"employed": false
}
];
when i run this am getting the whole object "{'id':'3','name':'Emir'}"
in id
column but i want only that id property value to show in that column.
and this is my plunker http://plnkr.co/edit/AMeTxuMMBmfVt9f0t7HZ?p=preview