Conditionally change the CSS of an ExtJS Gridpanel row

image[5]

How to do it

In the grid class you add the following lines to your initComponent function of your gridpanel class:

You can change the field and CSS styles to your own needs, but the last thing to do is to add some rules to the CSS of your application
Johan van de Merwe
Dedicated to professional software development since 1985. Has worked since 1992 as IT manager in several international operating companies. Since 2007 CEO and Sencha Ext JS web application developer at Enovision GmbH.

Comments

  1. Sanjoy Roy

    Hello Brother,

    Instead of the class can we somehow use the style getRowStyle()?

    I am actually going to use a color picker and wanted to use the style in return instead of class which I have define it in a css file.

    Ext.getCmp(‘client_grid’).getView().getRowClass = function(record, index) {
    switch (record.data.task_status) {
    case ‘New’:
    return “newtask”;
    break;
    }

    Thanks in advance.

    Regards,
    Sanjoy

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.