EasyUI 条件设置行背景颜色

数据网格(datagrid)的 rowStyler 函数的设计目的是允许您自定义行样式。

查询用户并设置不允许收费的用户背景色突出显示

function onReady(){
    $('#basicInfoList').datagrid("options").url=rootpath+"/queryPageListBySql?sqlKey=com.online.charge.customer.jccustomer.mapper.JcCustomerExtendsMapper.selectAllList";
    var conditions = [];
    gridLoad(conditions,null);
    showColor();
}

//不允许收费显示背景色
function showColor(){
    $('#basicInfoList').datagrid({
        rowStyler:function(index,row){
            if (row.isAllowCharge == "0" || row.isAllowCharge == 0){
                return 'background-color:#668B8B;';
            }
        }
    });
}

效果如下

http://www.jeasyui.net/tutorial/42.html

猜你喜欢

转载自www.cnblogs.com/zjfjava/p/9082500.html
今日推荐