Blogger Information
Blog 81
fans 1
comment 0
visits 124065
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
layui 在表单中动态修改复选框的选中状态
有什么是忘不了的的博客
Original
3193 people have browsed it

我要实现的效果,当我点击添加的时候可以动态的选中复选框。

E}QQFA%WM]67Z]25`~]13@N.png


代码:

当我们点击,添加的时候,会得到一个obj。

//这里必须使用prop来设置,obj.tr[0]可以获取整行节点
$(obj.tr[0]).find('input[type="checkbox"]').prop('checked',true)
//冲刷页面。很多时候的复选框无效,是因为没有做这一步。
form.render();

`K80Z_U%Z0_8BQRD})QNY(1.png







Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post