layui的点击table行选中复选框

 1          $(document).on("click",".layui-table-body table.layui-table tbody tr",function(){
 2         var obj = event ? event.target : event.srcElement;
 3         var tag = obj.tagName;
 4         var checkbox = $(this).find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
 5         if(checkbox.length!=0){
 6             if(tag == 'DIV') {
 7                 checkbox.click();
 8             }
 9         }
10         
11     });
12     
13     $(document).on("click","td div.laytable-cell-checkbox div.layui-form-checkbox",function(e){
14         e.stopPropagation();
15     });

 

posted @ 2018-06-02 10:31  前端极客  阅读(22088)  评论(1编辑  收藏  举报