如:审查级别想转换为对应的文字说明
方法一:
table.render({
elem: 'tableId'
,url:'访问路径'
,method:'post'
,id: 'table_reload'
,page: true
,height: 400
,cols: [[
{field:'cpbType', title: '审查级别', width:80}
]]
,done:function (res) {
$("[data-field = 'cpbType']").children().each(function () {
// console.log($(this).text())
if ($.trim($(this).text()) == 'A'){
$(this).text("中文A");
}else if ($.trim($(this).text()) == 'F'){
$(this).text("中文F");
}
})
}
});
方法二:
<script type="text/html" id="lv_explain">
{{# if(d.asmtLvId == 1){ }}
禁忌
{{# }else if(d.asmtLvId == 2){ }}
不推荐
{{# }else {d.asmtLvId == 3 }}
谨慎
{{# } }}
</script>
,cols: [[
{field:'asmtLvId', title: '审查级别', width:100,templet : '#lv_explain'}
,{field:'drc', title: '详细信息',width:250}
,{field:'drcRes', title: '参考资料', width:250}
,{field:'operate', toolbar: '#barDemo',title: '操作',width:130,align:'center',fixed:'right'}
]]