This example demonstrates how to use the onCellPrepared event to implement conditional formatting. The onCellPrepared event handler arguments contains the current grid cell element and grid row data, ...
if you don't like how the formatter laid out your code, you may need to introduce new functions/variables the formatter is not as clever as humans are, so it can sometimes produce less readable code ...