1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const toggleSelect = function(type){
|
9 | var index = this.parent.getRowIndex(this);
|
10 | var selectindices = this.parent.getSelectedIndices();
|
11 | if (selectindices.indexOf(index) != -1){
|
12 | this.parent.setRowUnSelect(index);
|
13 | }else{
|
14 | if (type === 'single')
|
15 | this.parent.setRowSelect(index);
|
16 | else
|
17 | this.parent.addRowSelect(index);
|
18 | }
|
19 | };
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | const singleSelect = function(){
|
25 | this.toggleSelect('single');
|
26 | };
|
27 |
|
28 | const multiSelect = function(){
|
29 | this.toggleSelect('multi');
|
30 | };
|
31 |
|
32 | export{
|
33 | toggleSelect,
|
34 | singleSelect,
|
35 | multiSelect
|
36 | } |
\ | No newline at end of file |