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