通过点击选中的checkbox获取该行td的值 并将对象封装,返回JSON对象 ...
方式一 var selectList jQuery .table tbody input type checkbox :checked .map function var id jQuery.trim jQuery this .closest tr .find td:eq .text selectList id , selectList selectList.substring ,selectLi ...
2017-10-25 17:10 0 5592 推荐指数:
通过点击选中的checkbox获取该行td的值 并将对象封装,返回JSON对象 ...
使用了jquery.js 主要是将<input/>放在<td></td>中,根据checkbox选中的状态遍历,每一行 var row = $(this).parent("td").parent("tr");然后将需要获取的值设置一个name ...
<table id='grid' class='easyui-datagrid' style='width:950px;height:405px' url='Ajax-index.php?module=<{$module_name}> ...
1. 获取当前行选中的index 首先,给table加一个属性::row-class-name="tableRowClassName" 然后给表格添加: @row-click = "onRowClick" 这时属性 ...
第一种方法:将index放到row数据中 首先,给table加一个属性::row-class-name="tableRowClassName" 然后定义tableRowClassName函数:(tableRowClassName可以自己改名) 然后给表格添加: @row-click ...
使用checkbox选中时有一个触发事件,那么触发事件可以调用下面的方法: ...
var a= $table.bootstrapTable('getSelections'); if(a.length==1){ b.val(a[0].id); }else{alert("请选中一行")} ...
table.on('checkbox(table-id)', function(obj){ console.log(obj.checked); //当前是否选中状态 console.log(obj.data); //选中行的相关数据 console.log(obj.type ...