I have data in below format,
$scope.myStudentData = {"Moroni":{"id":"1","grade":"A"},"Tiancum":{"id":"2","grade":"B"}}
But what is expected by grid is,
$scope.myGridOptions = [{"details":"id", "Moroni":"1", "Tiancum":"2"},{"details":"grade", "Moroni":"A", "Tiancum":"B"}];
This is because the ng-grid-options expects rows. Is there a way we can make a grid column-wise? Note: I want to use angular two-way binding between some derived fields and hence, not transforming the data into the format expected by grid.
You can actually.
And
Where
users
is your array of objects and your column definitions the columns you want to display. The field property must match the fields in your objects.The API of gridoptions can be found here.