How can I change the row colour in datagrid based on severity?

前端 未结 3 791
清歌不尽
清歌不尽 2020-12-15 11:24

How can I change the row colour in datagrid based upon the severity condition? I\'m new to this EXTJS topic. I used to reader to read, store to store and writer to write the

3条回答
  •  时光取名叫无心
    2020-12-15 11:52

    You can do it by using the getRowClass method of GridView (see Ext JS API).

    Quoted example from API documentation:

    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(this.showPreview){
                rp.body = '

    '+record.data.excerpt+'

    '; return 'x-grid3-row-expanded'; } return 'x-grid3-row-collapsed'; } },

提交回复
热议问题