码迷,mamicode.com
首页 > 其他好文 > 详细

easyui datagrid 单元格加进度条(亲测可用)

时间:2018-03-11 19:14:53      阅读:1176      评论:0      收藏:0      [点我收藏+]

标签:div   att   str   data   text   tag   line   image   color   

 1 {field: ‘DataItemNum‘, title: ‘数据完整度‘, width: 100, formatter: function (v, r, i) {
 2 var p = (v / 27) * 100;
 3 var value = Math.ceil(p);
 4 var htmlstr = ‘<div class="easyui-progressbar progressbar easyui-fluid" style="width: 100%; height: 20px;">‘
 5 + ‘<div class="progressbar-value" style="width: 100%; height: 20px; line-height: 20px;"> ‘
 6 + ‘<div class="progressbar-text" style="width: ‘ + value+‘%‘+ ‘; height: 20px; line-height: 20px;">‘ + value+ ‘%</div>‘
 7 + ‘</div>‘
 8 + ‘</div>‘;
 9 return htmlstr;
10 
11 }

技术分享图片

进度条长度这里要写成  xx%  格式

渲染效果

技术分享图片

 

easyui datagrid 单元格加进度条(亲测可用)

标签:div   att   str   data   text   tag   line   image   color   

原文地址:https://www.cnblogs.com/qbz95/p/8544923.html

(1)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!