Help with Array in columnDefs
Hallo, I don't know if I'm right here. Please refer this to the right place if I'm wrong. The data: An array of Objects with an array of Objects: [ { sid:"bla", data: [{ time: 0, value: 0 }] }]
The columnDef:
$scope.gridOptions = {
data: 'chosenSignals',
columnDefs: [
{field:'sid', displayName:'Signal-Id'},
{field:'data[0].value', displayName:'Wert'} // 1.
]
};
- At the moment the first Value is displayed correctly. How is it possible to display the last value of data? data.length -1 doesn't work.
Thanks
I would transform your data array. The grid is set up to map each row to an array element, not multiple rows to various properties inside a single array element. On Feb 6, 2014 10:19 AM, "eddi0815" [email protected] wrote:
Hallo, I don't know if I'm right here. Please refer this to the right place if I'm wrong. The data: An array of Objects with an array of Objects: [ { sid:"bla", data: [{ time: 0, value: 0 }] }]
The columnDef: $scope.gridOptions = { data: 'chosenSignals', columnDefs: [ {field:'sid', displayName:'Signal-Id'}, {field:'data[0].value', displayName:'Wert'} // 1.
] };
- At the moment the first Value is displayed correctly. How is it possible to display the last value of data? data.length -1 doesn't work.
Thanks
Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ng-grid/issues/974 .
try using a cellTemplate for {field:'data[0].value', displayName:'Wert'}