首页 新闻 会员 周边

如何在easyui的DataGrid的单元格添加ProgressBar进度条

1
[待解决问题]

如何在easyui的DataGrid的单元格添加ProgressBar进度条 谢谢  http://weichao202.iteye.com/blog/1731704 参照这位仁兄的代码 还是没有效果 

 

     在此苦等,O(∩_∩)O~

静欲动的主页 静欲动 | 初学一级 | 园豆:197
提问于:2013-10-14 17:29
< >
分享
所有回答(4)
-1
            //通过formatter格式话,进行拼接进度条
            $('#tt').datagrid({
                url: '/Exam/LoadAllExamJson',
                title: '试题列表',  //标题
                width: 900,  //宽度900
                height: 455,  //高度455
                fitColumns: true,  //列自适应
                idField: 'ExamId', //主键的列名
                loadMsg: '正在加载试题的信息...',  //等待 展示的文字
                pagination: true,  //是否分页
                singleSelect: true, //是否单行选择
                pageSize: 100, //一页多少条数据
                pageNumber: 1, //当前默认页
                pageList: [100],
                rownumbers: true,  //显示行号
                queryParams: params,  //往后台传送数据
                columns: [[
                        { field: 'ExamId', title: '编号', width: 30, align: 'center' },
                        { field: 'ExamContent', title: '试题名称', width: 500, align: 'left' },
                        { field: 'ExamType', title: '选择', width: 85, align: 'center',
                            formatter: function (value, row, index) {
                                //将后台的进度条的value进行拼接  *****
                                var htmlstr = '<div class="progressbar-text" style="width:398px;">' + value + '</div><div class="progressbar-value" style="width:' + value + ';"> </div>';
                                return htmlstr;
                            }
                        }
                    ]],
                onHeaderContextMenu: function (e, field) {

                },
                onSelect: function () {
                    bindRadioChanges();
                }
            });
秋壶冰月 | 园豆:5903 (大侠五级) | 2013-10-15 17:06

兄弟,问题解决了!var htmlstr = '<div class="progressbar-text" style="width:398px;">' + value + '</div><div class="progressbar-value" style="width:' + value + ';">&nbsp; </div>';

加一个空格!

支持(0) 反对(0) allon6318 | 园豆:858 (小虾三级) | 2013-12-20 16:43

按照你的说,我尝试了下,貌似不行,那一列是空白的啊。。。

支持(0) 反对(0) Suny_cheng | 园豆:200 (初学一级) | 2016-01-07 16:13
0

楼主,该问题解决了么?我也是解决不了~~~

allon6318 | 园豆:858 (小虾三级) | 2013-12-20 16:10

var htmlstr = '<div class="progressbar-text" style="width:398px;">' + value + '</div><div class="progressbar-value" style="width:' + parseInt(vlaue)="px" + ';">&nbsp </div>';

<style type="text/css">
.progressbar-value{
background: #d2fee1;
}
.progressbar-text{
z-index: 2;
}
</style>

亲测可用

支持(0) 反对(0) liubin9293 | 园豆:202 (菜鸟二级) | 2016-03-17 17:08
0

解决不了啊

liubin9293 | 园豆:202 (菜鸟二级) | 2016-03-17 16:45
0

var htmlstr = '<div class="easyui-progressbar progressbar easyui-fluid" data-options="value:' + value + '" style="width: 100%; height: 22px;">' +
'<div class="progressbar-text" style="width: 99%; height: 20px; line-height: 20px;">' + value + '%</div>' +
'<div class="progressbar-value" style="width: '+value+'%; height: 20px; line-height: 20px;">' +
'<div class="progressbar-text" style="width: 99%; height: 20px; line-height: 20px;">' + value + '%</div></div></div>';

已经超神 | 园豆:214 (菜鸟二级) | 2016-10-27 17:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册