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