<tr class="b-group">
<th width="10%">
<label>{$v['title']}
<input type="checkbox" name="rule_ids[]" value="{$v['id']}" <if condition="in_array($v['id'],$group_data['rules'])"> checked="checked"</if> οnclick="checkAll(this)">
</label>
</th>
<td class="b-child">
<foreach name="v['_data']" item="n">
<table class="table table-striped table-bordered table-hover table-condensed">
<tr class="b-group">
<th width="10%">
<label>{$n['title']} <input type="checkbox" name="rule_ids[]" value="{$n['id']}" <if condition="in_array($n['id'],$group_data['rules'])"> checked="checked"</if> οnclick="checkAll(this)">
</label>
</th>
<td>
<notempty name="n['_data']">
<volist name="n['_data']" id="c">
<label> {$c['title']}
<input type="checkbox" name="rule_ids[]" value="{$c['id']}" <if condition="in_array($c['id'],$group_data['rules'])"> checked="checked"</if> >
</label>
</volist>
</notempty>
</td>
</tr>
</table>
</foreach>
</td>
</tr>
<script>
function checkAll(obj){
$(obj).parents('.b-group').eq(0).find("input[type='checkbox']").prop('checked', $(obj).prop('checked'));
}
</script>
JQ权限类勾选
最新推荐文章于 2022-06-16 21:07:30 发布