1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2016, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['../../../lib/@waca/core-client/js/core-client/ui/core/Class', 'underscore'], function (Class, _) {
- 'use strict';
- var GridDataProvider = Class.extend({
- _data: null,
- _numRows: null,
- _numColumns: null,
- init: function init(data) {
- if (data) {
- this._data = data;
- this._setDataDimensions();
- }
- },
- getNumRows: function getNumRows() {
- return this._numRows;
- },
- getNumColumns: function getNumColumns() {
- return this._numColumns;
- },
- getValue: function getValue(rowIndex, columnIndex) {
- return this._data[rowIndex][columnIndex];
- },
- _setDataDimensions: function _setDataDimensions() {
- if (this._data) {
- this._numRows = this._data.length;
- this._numColumns = _.isArray(this._data[0]) ? this._data[0].length : 0;
- }
- },
- updateData: function updateData(data) {
- if (data) {
- this._data = data;
- this._setDataDimensions();
- }
- }
- });
- return GridDataProvider;
- });
- //# sourceMappingURL=GridDataProvider.js.map
|