橘子味阳光
2016-04-25 01:58jquery 选中 checkbox undefined
5 "aoColumnDefs":
[
{'bVisible': false, 'aTargets': []},
{'bSortable': false, 'aTargets': []},
{
// "sTitle": "we",
// "sClass" :"center",
"sWidth": "10%",
"mData" : null,
"aTargets" : [ 0 ],
"mRender": function(data){
return "<input type='checkbox' name='productCheckbox' id='"+data.businessId+"' value='"+data.businessId+"'>";
}
},
success: function(data){
console.log("checkboxselected============="+data.actConfg);
$(data.actConfg).each(function(i,item){
console.log("checkboxselected============="+item.businessId);
//$('input:checkbox').eq(0).attr("checked",'true');
$(":checkbox[value='22']").prop("checked",true);
$("input:checkbox[value='"+item.businessId+"']").attr('checked','true');
//$("input[id='"+item.businessId+"']:checkbox").attr("checked",true)
console.log("hhhhhhhhhhhhh=============");
});
}
操作不了动态生成的,静态直接写的可以为什么? $("input:checkbox[value='"+item.businessId+"']")这个取到的是undefined
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- js全选后遍历取出的值是undefined改怎么解决?
- ajax
- javascript
- react.js
- jquery
- angular.js
- 2个回答
- 使用JQuery获取div中未选中复选框的值
- html
- javascript
- php
- jquery
- checkbox
- 2个回答
- 淘淘商城运行users.jsp页面出现400错误。
- java
- maven
- tomcat
- eclipse
- java-ee
- 1个回答
- bootstraptable-edit使用问题
- html5
- javascript
- 1个回答
- jquery 选中 checkbox undefined
- 函数
- checkbox
- jquery
- 1个回答
换一换