UNPKG

1.16 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports._formatToIndicesArray = exports.isChanged = undefined;
7
8var _util = require('tinper-sparrow/src/util');
9
10var isChanged = function isChanged() {
11 var rows = this.getAllRows();
12 for (var i = 0; i < rows.length; i++) {
13 if (rows[i].status != Row.STATUS.NORMAL) return true;
14 }
15 return false;
16}; /**
17 * Module : kero dataTable util
18 * Author : liuyk(liuyk@yonyou.com)
19 * Date : 2016-08-08 09:59:01
20 */
21
22
23var _formatToIndicesArray = function _formatToIndicesArray(dataTableObj, indices) {
24 if (typeof indices == 'string' || typeof indices == 'number') {
25 indices = [indices];
26 } else if (indices instanceof Row) {
27 indices = [dataTableObj.getIndexByRowId(indices.rowId)];
28 } else if ((0, _util.isArray)(indices) && indices.length > 0 && indices[0] instanceof Row) {
29 for (var i = 0; i < indices.length; i++) {
30 indices[i] = dataTableObj.getIndexByRowId(indices[i].rowId);
31 }
32 }
33 return indices;
34};
35
36exports.isChanged = isChanged;
37exports._formatToIndicesArray = _formatToIndicesArray;
\No newline at end of file