1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import {
|
7 | isArray
|
8 | } from 'tinper-sparrow/src/util';
|
9 |
|
10 |
|
11 | const isChanged = function() {
|
12 | var rows = this.getAllRows()
|
13 | for (var i = 0; i < rows.length; i++) {
|
14 | if (rows[i].status != Row.STATUS.NORMAL)
|
15 | return true
|
16 | }
|
17 | return false
|
18 | }
|
19 |
|
20 |
|
21 | const _formatToIndicesArray = function(dataTableObj, indices) {
|
22 | if (typeof indices == 'string' || typeof indices == 'number') {
|
23 | indices = [indices]
|
24 | } else if (indices instanceof Row) {
|
25 | indices = [dataTableObj.getIndexByRowId(indices.rowId)]
|
26 | } else if (isArray(indices) && indices.length > 0 && indices[0] instanceof Row) {
|
27 | for (var i = 0; i < indices.length; i++) {
|
28 | indices[i] = dataTableObj.getIndexByRowId(indices[i].rowId)
|
29 | }
|
30 | }
|
31 | return indices;
|
32 | };
|
33 |
|
34 | export const utilFunObj = {
|
35 | isChanged: isChanged,
|
36 | _formatToIndicesArray: _formatToIndicesArray
|
37 |
|
38 | }
|