jQuery MiniUI

标题: 渲染行背景色 [打印本页]

作者: 18883794127    时间: 2016-10-18 14:12:42     标题: 渲染行背景色

$(function() {
        // 在 mini 界面初始化之后执行
        var grid = mini.get("datagrid");
                // 注册单元格渲染事件
        grid.on("drawcell", drawCell);
        function drawCell(e) {
        var row = e.record, field = e.field, val = e.value;
       
        // 用当前列的值
        if (field == "isVerify") {
        if (val ==1) {
        // e.cellHtml = "<font color=red>" + val + "</font>";
        //e.cellStyle = "background:lightpink";
        // 行样式(不建议设置)
        e.rowStyle = "background:lightblue";
        }else{
        e.rowStyle = "background:yellow";
        }
        }
        }
       
        });
这个需要把前面的序号也一起渲染



作者: felt    时间: 2016-10-18 15:08:30

整行样式是包括序号列的,你序号列有什么特殊处理的,对背景色有影响了?




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2