miniui中常用的状态显示方式
1.查询sys_code表得到对应的状态
考生状态:<input class="mini-combobox" style="" textField="text" valueField="id" name ="status" id="status"
url="<%=basePath%>manager/paramQuery/STATUS.action" showNullItem="true" allowInput="true" />
2.页面上直接给,选择保留到后台是对应的value值 代码
是否改报:<input class="mini-combobox" style="" name ="state" id="state"
data="[{id:0,text:'是'},{id:1,text:'否'}]" allowInput="true" /><br>
3.datagrid中有状态的 需要显示则在js中写显示方式
<td id="d2">
<div class="mini-fit" >
<div id="datagrid2" class="mini-datagrid" url="<%=basePath%>manager/exam/jobs/jobsList.action"
style="width:100%;height:100%;"
allowResize="true" multiSelect="true" idField="id" showFooter="false" >
<div property="columns">
<div field="department" vtype="required;" headerAlign="center" align="center">部门</div>
<div field="jobname" vtype="required;" headerAlign="center" align="center">职位名称</div>
<div field="jobcode" vtype="required;" headerAlign="center" align="center">职位代码</div>
<div field="jobnum" vtype="required;" headerAlign="center" align="center">人数</div>
<div field="status" vtype="required;" headerAlign="center" align="center" renderer="onActionRenderer">岗位状态</div>
</div>
</div>
</div>
</td>
//岗位状态
var Status = [{ id: 1, text: '正常' }, { id: 2, text: '岗位撤销'}];
function onActionRenderer(e) {
for (var i = 0, l = Status.length; i < l; i++) {
var g = Status[i];
if (g.id == e.value) return g.text;
}
return "";
}