layui的点击table行选中复选框
2019-04-10 本文已影响0人
学无_止境
$(document).on("click",".layui-table-body table.layui-table tbody tr",function(){
var obj = event ? event.target : event.srcElement;
var tag = obj.tagName;
var checkbox = $(this).find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
if(checkbox.length!=0){
if(tag == 'DIV') {
checkbox.click();
}
}
});
$(document).on("click","td div.laytable-cell-checkbox div.layui-form-checkbox",function(e){
e.stopPropagation();
});