layui 监听表格复选框选中值的方法 需要达到的目的: ajax()异步请求后台时,需要传入表格里复选框选中的id值 注意:在渲染form on 方法的done里面加入 done:function(res){ table_data=res.data; } 将复选框选中的值的id加入数组中,然后传递到后台作为ids参数 //自定义数组 var table_data=new Array(); var ids =new Array(); table.on('checkbox(push_port_table)', function(obj){ if(obj.checked==true){ if(obj.type=='one'){ ids.push(obj.data.id); }else{ for(var i=0;i