<div class="radio-box" th:each="dict : ${@dict.getType('quanxian')}">
<label th:for="${'permissions_' + dict.dictCode}" >
<input name="permissions" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
</label>
<!-- 放外面 否则会多次添加-->
<input th:value="*{permissions}" id="quanxian" type="hidden">//回显用添加页不用
</div>
$("[name='permissions']").each(function(){
const that=$(this)
if($("#quanxian").val().indexOf(that.val())!=-1&&that.attr("checked")!=1)
that.attr("checked",1)
})
显示页删字段字典
若依多选框
最新推荐文章于 2024-09-13 14:30:33 发布