kero
Version:
36 lines (31 loc) • 721 B
JavaScript
/**
* Module : kero dataTable row rowSelect
* Author : liuyk(liuyk@yonyou.com)
* Date : 2016-08-08 13:54:01
*/
const toggleSelect = function(type){
var index = this.parent.getRowIndex(this);
var selectindices = this.parent.getSelectedIndices();
if (selectindices.indexOf(index) != -1){
this.parent.setRowUnSelect(index);
}else{
if (type === 'single')
this.parent.setRowSelect(index);
else
this.parent.addRowSelect(index);
}
};
/**
* 行点击事件
*/
const singleSelect = function(){
this.toggleSelect('single');
};
const multiSelect = function(){
this.toggleSelect('multi');
};
export{
toggleSelect,
singleSelect,
multiSelect
}