Victor Woeltjen e711073cb5 [Scrolling] Add JSDoc, clean up
Clean up scripts for Scrolling List view and add
some JSDoc. WTD-534.
2014-12-02 15:21:26 -08:00

43 lines
1.3 KiB
JavaScript

/*global define,Promise*/
/**
* Module defining DomainColumn. Created by vwoeltje on 11/18/14.
*/
define(
[],
function () {
"use strict";
/**
* A column which will report telemetry range values
* (typically, measurements.) Used by the ScrollingListController.
*
* @constructor
* @param rangeMetadata an object with the machine- and human-
* readable names for this range (in `key` and `name`
* fields, respectively.)
*/
function RangeColumn(rangeMetadata) {
return {
/**
* Get the title to display in this column's header.
* @returns {string} the title to display
*/
getTitle: function () {
return rangeMetadata.name;
},
/**
* Get the text to display inside a row under this
* column.
* @returns {string} the text to display
*/
getValue: function (domainObject, data, index) {
var value = data.getRangeValue(index, rangeMetadata.key);
return value && value.toFixed(3);
}
};
}
return RangeColumn;
}
);