数据库表中字段类型char时候,即使编辑/新增的弹出框取得数据,但也不会在页面显示
数据库表中字段类型varchar时候,编辑/新增的弹出框取得数据,同时在页面显示
对应的前端代码(部分)
columns: [[
{
field: 'danger', title: '危险区域', width: 100, sortable: true, formatter: function (value, row, index) {
//
var vType = "";
if (value == "Y")
vType = "是";
else if (value == "N")
vType = "否";
return vType
}
},
{ field: 'rankId', title: '安保等级', width: 100, sortable: true , formatter: function (value, row, index){
var vType = "";
if (value == "1")
vType = "一级安保";
else if (value == "2")
vType = "二级安保";
else if (value == "3")
vType = "三级安保";
return vType
}
},
{ field: 'safetyId', title: '安全定义', width: 100, sortable: true, formatter: function (value, row, index) {
var vType = "";
if (value == "1")
vType = "十分安全";
else if (value == "2")
vType = "安全";
else if (value == "3")
vType = "危险";
return vType
}}
]],
<td>是否危险区域:</td>
<td>
<select id="danger" name="danger" class="easyui-combobox" ET="ComboBox" style="height:28px;">
<option value="">请选择</option>
<option value="Y">是</option>
<option value="N">否</option>
</select>
</td>
</tr>
<tr>
<td>安全定义:</td>
<td>
<select id="safetyId" name="safetyId" class="easyui-combobox" ET="ComboBox" style="height:28px;">
<option value="">请选择</option>
<option value="1">十分安全</option>
<option value="2">安全</option>
<option value="3">危险</option>
</select>
</td>
<td>安保等级:</td>
<td>
<select id="rankId" class="easyui-combobox" ET="ComboBox" style="height:28px;">
<option value="">请选择</option>
<option value="1">一级安保</option>
<option value="2">二级安保</option>
<option value="3">三级安保</option>
</select>
</td>
</tr>
来看一下页面(可以看到危险区域空白,安保等级和安全定义在页面中显示数据)
分析: