1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var getSimpleData = function getSimpleData(options) {
|
16 | options = options || {};
|
17 | var rows,
|
18 | _rowData = [],
|
19 | type = options['type'] || 'all',
|
20 | fields = options['fields'] || null;
|
21 |
|
22 | if (type === 'all') {
|
23 | rows = this.rows.peek();
|
24 | } else if (type === 'current') {
|
25 | var currRow = this.getCurrentRow();
|
26 | rows = currRow == null ? [] : [currRow];
|
27 | } else if (type === 'focus') {
|
28 | var focusRow = this.getFocusRow();
|
29 | rows = focusRow == null ? [] : [focusRow];
|
30 | } else if (type === 'select') {
|
31 | rows = this.getSelectedRows();
|
32 | } else if (type === 'change') {
|
33 | rows = this.getChangedRows();
|
34 | }
|
35 |
|
36 | for (var i = 0; i < rows.length; i++) {
|
37 | _rowData.push(rows[i].getSimpleData({ fields: fields }));
|
38 | }
|
39 | if (_rowData.length == 0) {
|
40 | _rowData = this.setSimpleDataReal;
|
41 | }
|
42 | return _rowData;
|
43 | };
|
44 |
|
45 | exports.getSimpleData = getSimpleData; |
\ | No newline at end of file |