$(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"); var dataIndex = $(this).attr("data-index"); if($(this).parents(".layui-table-fixed").length>0){ if(checkbox.length!=0){ if(tag == ‘DIV‘) { checkbox.click(); } } }else{ var checkbox1=$(this).parents(".layui-table-body").next().find(".layui-table-body table.layui-table tbody tr[data-index="+dataIndex+"]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I");; if(checkbox1.length!=0){ if(tag == ‘DIV‘) { checkbox1.click(); } } }}); $(document).on("click","td div.laytable-cell-checkbox div.layui-form-checkbox",function(e){ e.stopPropagation();});
原文地址:https://www.cnblogs.com/wdd-cindy/p/9829102.html
时间: 2024-11-05 18:47:18