EXTJS4.2 控件之Grid getRowClass 添加行背景色

css 样式:

/*交流管理系统 开始*/
tr.x-grid-record-blue .x-grid-td { background: #87CEFF; }/*grid 行颜色*/

tr.x-grid-record-green .x-grid-td { background: #00ff90 }/*grid 行颜色*/
/*交流管理系统 结束*/

js:代码一

    viewConfig: {
        forceFit: true,
        stripeRows: true,
        getRowClass: changeRowClass
    },

    代码二

function changeRowClass(record, rowIndex, rowParams, store) {

    if (record.get("SegmentType") == "1") {
        return 'x-grid-record-blue';
    } else {
        return 'x-grid-record-green';
    }
}

 

链接相关:http://www.qeefee.com/article/000424

 

posted @ 2015-05-12 11:30  秋风过、枯叶落  阅读(1636)  评论(0编辑  收藏  举报