easyui字典js 切换 jsp页面显示的内容
在列表中直接切换
formatter: function (value) {
var name;
if(value==0){
name='待审批'
}else if(value==1){
name='通过'
}else if(value==2){
name='拒绝'
}else{
name='退回修改'
}
return name;
}
jsp中代码====调用字典
1.1形式
<th field="ccy" width="15%" formatter="mrdict.REQ_CCYFormatter" autocomplete="off" >交易币种</th>
1.2形式
$('#fangan_list').datagrid({
width: '800',
height:'100',
striped: true,
fit:true,
pagination:true,scrollbarSize:0,
singleSelect:true,
url:'<%=basePath%>xyData/xyMonitoringDisease/selectOneRecordProgrameList.do?idStr='+ myidStr,
loadMsg : '数据加载中请稍后……',
columns : [ [{
field : 't_method',
title : '治疗方法',
align : 'center',
resizable:false,
width:'13%',
formatter: function(value, row){//414
var dict = mrdict.治疗方法;
var o1 = dict[value];
if( !o1 ) {
return value;
} else {
return o1;
}
}
},
字典js中代码=======
var mrdict = new Object();
mrdict.人员姓名类别={"01":"中文全名","06":"其他外语曾用名","05":"其他外语全名","04":"英文曾用名(中文拼音)","03":"英文全名(中文拼音)","02":"中文曾用名"};
mrdict.卫生职称等级={"6":"护理","54":"副主任放射技师","52":"初级放射技师","51":"初级放射技士","5":"放射","45":"主任检验师","44":"副主任检验师","43":"检验主管技师","42":"初级检验技师","3":"中医学","74":"高级治疗师","61":"护士","55":"主任放射技师","63":"主管护师","64":"副主任护师","65":"主任护师","7":"康复技师","71":"康复治疗士","72":"初级康复治疗师","73":"中级治疗师","41":"初级检验技士","4":"检验","12":"医师","13":"主治医师","23":"中级主管药师","14":"副主任医师","15":"主任医师","22":"初级药师","2":"药学","21":"初级药士","11":"医士","1":"医师","35":"主任药剂师","34":"副主任药剂师","33":"中级主管中药师","32":"初级中药师","31":"初级中药士","62":"护师","24":"副主任药剂师","25":"主任药剂师","53":"放射主管技师"};
mrdict.人员姓名类别Formatter = function(val,row) {
var data = mrdict.人员姓名类别;
try {
if( !data.hasOwnProperty(val) ) {
return val;
}
} catch(error) {
console.error(error);
return val;
}
return data[val];
}
mrdict.卫生职称等级Formatter = function(val,row) {
var data = mrdict.卫生职称等级;
try {
if( !data.hasOwnProperty(val) ) {
return val;
}
} catch(error) {
console.error(error);
return val;
}
return data[val];
}