extjs change grid cell background based on value

Roman

I applied a renderer to my grid-column, but the background color is not changing:

renderer: function(value, meta) {
    if (parseInt(value) > 0) {
        meta.tdCls = 'category-matching'; return value;
    }
    else { 
        meta.tdCls = 'category-not-matching'; return value;
    }
}

css:

.x-grid-cell .category-matching {
    background-color:green;
}
.x-grid-cell .category-not-matching {
    background-color:red;
}

I also tried

.grid-cell-inner

and

background-color:red; !important

but no effect.

Any idea?

Sivakumar

Try this...

renderer : function(value, meta) {
    if(parseInt(value) > 0) {
        meta.style = "background-color:green;";
    } else {
        meta.style = "background-color:red;";
    }
    return value;
}

It works for me.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

extjs change grid cell background based on value

From Dev

Change Row background color based on cell value

From Dev

How to change DataGrid cell background color based on cell value

From Dev

How to change background color of cell based on other cell value by VBA

From Dev

Change Row background color based on cell value DataTable

From Dev

Using javascript to change table cell background color based on json value

From Dev

Change cell background based on value from a different column

From Dev

How to Change the row Background color based on cell value

From Dev

WPF - Change DataGridTemplateColumn cell background based on CheckBox value

From Dev

How to Change the row Background color based on cell value

From Dev

Excel 2007: Change background color cells ->not based on value of cell

From Dev

How can I change a wpf Databound grid cell based on the cell value?

From Dev

Change value in a cell based on value in another cell

From Dev

change between 3 different background color based on cell value but only if another call value is different than

From Dev

How to change background color of grid's dirty cells in Extjs

From Dev

Need to change the background color of icon inside extjs grid action column

From Dev

WPF change cell background color based on content

From Dev

Change datagridview cell background based on a external parameter

From Dev

WPF change cell background color based on content

From Dev

change background color of a grid based on RadioButton

From Dev

UI Grid RowTemplate color based on cell value

From Dev

Hww to change cell value of grid row

From Dev

AG-Grid cell template value change

From Dev

How to create cell editor for speciall cell in grid with another grid and selection of value from it in ExtJs?

From Dev

How to create cell editor for speciall cell in grid with another grid and selection of value from it in ExtJs?

From Dev

Change colour of a cell based on the value in the cell and text in another cell

From Dev

Extjs: progressBar in cell grid not displaying

From Dev

How to change the background of a cell dynamically in a Kendo MVC UI Grid?

From Dev

How to Change Conditional Formatting of a Cell Based on a Change in the Cell Value

Related Related

  1. 1

    extjs change grid cell background based on value

  2. 2

    Change Row background color based on cell value

  3. 3

    How to change DataGrid cell background color based on cell value

  4. 4

    How to change background color of cell based on other cell value by VBA

  5. 5

    Change Row background color based on cell value DataTable

  6. 6

    Using javascript to change table cell background color based on json value

  7. 7

    Change cell background based on value from a different column

  8. 8

    How to Change the row Background color based on cell value

  9. 9

    WPF - Change DataGridTemplateColumn cell background based on CheckBox value

  10. 10

    How to Change the row Background color based on cell value

  11. 11

    Excel 2007: Change background color cells ->not based on value of cell

  12. 12

    How can I change a wpf Databound grid cell based on the cell value?

  13. 13

    Change value in a cell based on value in another cell

  14. 14

    change between 3 different background color based on cell value but only if another call value is different than

  15. 15

    How to change background color of grid's dirty cells in Extjs

  16. 16

    Need to change the background color of icon inside extjs grid action column

  17. 17

    WPF change cell background color based on content

  18. 18

    Change datagridview cell background based on a external parameter

  19. 19

    WPF change cell background color based on content

  20. 20

    change background color of a grid based on RadioButton

  21. 21

    UI Grid RowTemplate color based on cell value

  22. 22

    Hww to change cell value of grid row

  23. 23

    AG-Grid cell template value change

  24. 24

    How to create cell editor for speciall cell in grid with another grid and selection of value from it in ExtJs?

  25. 25

    How to create cell editor for speciall cell in grid with another grid and selection of value from it in ExtJs?

  26. 26

    Change colour of a cell based on the value in the cell and text in another cell

  27. 27

    Extjs: progressBar in cell grid not displaying

  28. 28

    How to change the background of a cell dynamically in a Kendo MVC UI Grid?

  29. 29

    How to Change Conditional Formatting of a Cell Based on a Change in the Cell Value

HotTag

Archive