数据库表里面字段的值想用另一种命名形式展示,如1是 是,2是 否 

 

easyUI datagrid值转义
easyUI datagrid值转义
 
解决方法: 用到formatter
  1. ,{field:'params', title:'参数', width:100, sortable:true, align:'left', hidden:true}
  2. ,{field:'type', title:'是否通过SQL获取', width:110, sortable:true, align:'left', hidden:false,
  3. formatter: function(value){
  4. if(value=='1'){
  5. return'是';
  6. }elseif(value=='2'){
  7. return'否';
  8. }else{
  9. return value;
  10. }
  11. }
  12. }
 





相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-11-23
  • 2021-06-20
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案