开发者

how to change the row background colour based upon some criteria in EXTJS

Dear Sir/Madam, I'm new to E开发者_如何学编程XTJS coding.I'm learning it.I've come across a problem of changing the row background colour based upon some criteria in complete EXTJS coding.Can you help me,please ?


You have to use getRowClass method in the GridView to set your custom CSS class of the row:

viewConfig: {
    forceFit: true,
    showPreview: true, // custom property
    enableRowBody: true, // required to create a second, full-width row to show expanded Record data
    getRowClass: function(record, rowIndex, rp, ds){ // rp = rowParams
        if(record.get('isRed')){
            return 'x-grid3-row-red';
        }
    }
},

Where you have defined your CSS class x-grid3-row-red.

Look for method getRowClass in documentation: http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.GridView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜