美文网首页
4.datagrid要点

4.datagrid要点

作者: 若愚同学 | 来源:发表于2018-06-12 22:31 被阅读0次
    columns:[[]],两个括号是因为可以有两行标题:
    columns:[[
                {field:'name',title:'绰号',width:100}
            ],
            [
                {field:'name',title:'姓名',width:100}
            ]]
    
    处理object在colomun中显示问题:
    {field:'dept',title:'部门',width:100,formatter:function (value,row,index) {
                        return value.name;
                    }
        
    }
    
    处理单个单元格背景色:
    {field:'state',title:"状态",width:100,formatter:function (value,row,index) {
                        return value?"在职":"离职";
        },styler:function (value,row,index) {
                        if(!value){
                            return 'background-color:pink;color:red'
                        }
                }
    }
    

    相关文章

      网友评论

          本文标题:4.datagrid要点

          本文链接:https://www.haomeiwen.com/subject/icqdeftx.html