UNPKG

721 BJavaScriptView Raw
1/**
2 * Module : kero dataTable row rowSelect
3 * Author : liuyk(liuyk@yonyou.com)
4 * Date : 2016-08-08 13:54:01
5 */
6
7
8const 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 */
24const singleSelect = function(){
25 this.toggleSelect('single');
26};
27
28const multiSelect = function(){
29 this.toggleSelect('multi');
30};
31
32export{
33 toggleSelect,
34 singleSelect,
35 multiSelect
36}
\No newline at end of file