更改EasyUI的DataGrid的显示。比如是否显示在数据库里存的是0和1.但是显示的时候想要显示“是”和“否”

来源:互联网 发布:手机淘宝打开详情黑屏 编辑:程序博客网 时间:2024/05/03 19:28
<table class="easyui-datagrid" data-options="url:'listJson.do',pageSize:15,fitColumns:'true'" width="width" id="useradmindata">

<thead>
   <tr>
  <th  data-options="field:'name',width:100">名称</th>
  <th  data-options="field:'sort',width:100" >排序</th>
  <th  data-options="field:'show',width:100" formatter="formatShow">是否显示</th>
  <th  data-options="field:'action',width:100" formatter="formatAction">操作</th>
  </tr>
</thead>

 </table>

----------------------------------------------------------------------------------------------------------------------------------------------------

<script type="text/javascript">
function formatShow(value,row,index){
if(value==1){
        return "是";
    }else{
        return "否";
}
}

</script>







0 0
原创粉丝点击