1》》》
今天实现一个 点击更新按钮 ,可以勾选上本行的的checkbox的功能:
使用代码:
1 /** 2 * updateproduct.htmls 更新 产品信息 3 */ 4 $(document).on("click",".table-bordered tbody tr a[class='up']",function(){ 5 product = $.parseJSON( $(this).parents('tr').find("input").eq(1).val()); 6 $(this).parents('tr').find("input[type='checkbox']").attr("checked",true);//在点击更新按钮之后,勾选本行对应的checkbox 7 indexProductUpdate = layer.open({ 8 type: 2, 9 title: "修改产品", 10 content: 'updateproduct.htmls', 11 area: ['500px', '580px'], 12 end : function(){ 13 $(".table-bordered tbody :checked").attr("checked",false); 14 } 15 }); 16 });