How to change the background color of a grid cell from contoller based on input value in ExtJS 4

603 Views Asked by At

I have an editable grid, and a Controller that manages the grid. One of the columns contains a user defined ReferenceID (this has to be unique). So, when the user add a new row to the grid, the user has to input the ReferenceID.

I listen the 'change' event from the Controller (see coder)

onProjectNumberFieldChange: function(me, newValue, oldValue, eOpts) {        
    var match = this.getProjectsStore().find('projectnumber', newValue);

    // Change the cell color
    if (match > 0){
        // change the text color
        me.setFieldStyle("color:#ff0000");
        // change the background-color
        // input the code here
    }
}

I can change the text color, but ...

Question: How can I change the cell background color?

Any ideas?

Thank you in advance, Manuel

0

There are 0 best solutions below