There's no built-in way to use column ID's to get data from the DataTable (you have to parse the table to find the index of a column with the given ID; not difficult, but it is an extra step). If your cumulative function can take a parameter for the column number, then you can use a method like this to create your calculated columns:
dataview.setColumns([1, 2, {
calc: function (dt, row) {
return sum(dt, row, 1);
},
type: 'number',
label: 'Foo :: Total
Distance'
}, {
calc: function (dt, row) {
return sum(dt, row, 2);
},
type: 'number',
label: 'Bar :: Total Distance'
}]);