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