笔记:防止自己忘了
行: <th><input type="checkbox" name="all" id="all" /></th>
行的值 :{
data : function(e){
return "<input type='checkbox' name='checkids' id='checkids' value='"+e.id+"'/>";
}
},
方法: $('#appTable tbody').on('click', 'tr', function () {
/* var data = table.row( this ).data();
alert( 'You clicked on '+data[0]+'\'s row' ); */
var input = $(this).find("input");
//alert($(input).prop("checked"));
if (!$(input).prop("checked")) {
$(input).prop("checked",true);
}else{
$(input).prop("checked",false);
}
} );
借鉴地址:https://blog.youkuaiyun.com/QQ459932400/article/details/79003521
本文介绍了一种在网页表格中通过点击行来切换该行内复选框状态的方法,利用jQuery实现行点击事件,使点击行时能够改变行内复选框的选中状态,提供了一个实用的交互解决方案。
856

被折叠的 条评论
为什么被折叠?



