Imagine having an array of objects structured like this:
{
name: ...
age: ...
dept: ...
}
Now, if you want to display these objects in an ng-grid with only columns for name
and age
, you can set it up like this:
columnDefs: [{field:'name'...},{field:'age'...}
Additionally, if you wish to group them by dept
without actually displaying the dept
column, it might seem tricky. Trying to add groups: ['dept']
to the grid options may not work as expected.
Some solutions involve using gridOptions.groupBy
, but sometimes this can lead to errors like undefined is not a function
when gridOptions
is a plain object.
So, the burning question is: Can you effectively group an ng-grid with a non-displayed column?