首页 > 其他 > 详细

index页面数据展示为设定的命名

时间:2017-01-09 11:13:33      阅读:214      评论:0      收藏:0      [点我收藏+]
数据库表里面字段的值想用另一种命名形式展示,如1是 是,2是 否 


技术分享
技术分享

解决方法: 用到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. } else if(value==‘2‘){
  7. return ‘否‘;
  8. } else{
  9. return value;
  10. }
  11. }
  12. }





index页面数据展示为设定的命名

原文:http://www.cnblogs.com/samwang88/p/75c75206fc81d08f0c242ab2d1c17238.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!