1. J2eeFAST 提供了强大的字典功能可以控制字典 CSS Style 回显样式 等功能
登录系统 [系统设置]-[字典管理]-新增 -> 新增字段数据 注意:统一规范 请务必使用小写字母下划线定义
- 页面展示
<#list dict.getType('sys_menu_type')><#items as d><#if d.status =='0' ><label class="radio-box"><input type="radio" name="type" value="${d.dictValue}" <#if d.isDefault =='Y'>checked</#if>><@ctx.i18n text = "${d.dictLabel}"/></label></#if></#items></#list>
- 页面回显
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "请假类型"/>:</label>
<div class="col-sm-8">
<input class="form-control" value="${dict.getLabel('sys_leave_type', bpmOaForm.leaveType)}" type="text" readonly="true">
</div>
</div>
</div>
- 表格回显使用
方式一:
var datas_type = ${dict.getDictListJson('sys_menu_type')};
......
{title: "<@ctx.i18n text = "类型"/>", field: 'type', width: '10%', formatter: function(value, row, index)
{
return $.table.selectDictLabel(datas_type, value);
}
},
.....
原理: 字典数据生成到页面,可以F12自行查看页面源码了解原理.
版本 2.6 以上表格支持以下方式回显:
方式二:
......
{title: "<@ctx.i18n text = "类型"/>", field: 'type', width: '10%', formatter: function(value, row, index)
{
return $.table.selectDictLabel("datas_type", value);
}
},
.....
原理: 将数据字段请求获取加载到本地浏览器缓存,此方式效率相对方式一应该更加好!
5. 如果还有问题请在issue提问或者加群咨询!!!
