Let's say I have the following data:
let data = [
{name: 'bob', bornOn: 1510174615339},
{name: 'mary', bornOn: 1510164615339}
]
If I pass this into a ui-grid i'll get 2 columns. In order to parse the epoch time to a human readable format. I need to do something like this:
$scope.gridOptions.columnDefs = [
{name: 'Name', field: 'name'},
{name: 'Born On', field: 'bornOn', cellFilter: 'date:"yyyy-MM-dd\"'}
]
I would like to be able to do something like this instead:
$scope.gridOptions.columnDefs = [
{name: 'Born On', field: 'bornOn', cellFilter: 'date:"yyyy-MM-dd\"'}
]
But then I lose the name field.
If I don't supply any column definitions I get every property back.
This is a bit contrived but in my actual project, I'm having to fetch objects with different properties but I don't want to manually set those different properties in their own column definitions. I just want to assign specific custom fields like the epoch times, but as soon as I set those column definitions the defaults don't get into the grid.
Is there a way to only customize a single column's columnDef but allow ui grid to default the rest of the property columns.