4

We need to conditionally make a row text as Bold. Currently its working on only single cell but we need to apply text bold on all columns cells. After applying the formatting 'isBold' column must be hide/remove. This column is used only for formatting. How to apply text-indent: 10px; of first column where the isBold column contains true value? Any possibility to achieve this?here is plunker http://plnkr.co/edit/YVGpi2FkwzCl3R1K8fwo?p=preview

Abu Sufyan
  • 197
  • 1
  • 2
  • 14

2 Answers2

1

This plunker is not valid any more.

I believe that you use cellStyle callback of the columnDefs to make the font bold.

If you need to do it for the whole row, create a common callback function and use it in cellStyle of all columnDefs.

There is no single command to change the style of a row.

Charlie
  • 22,886
  • 11
  • 59
  • 90
1

This is kind of old, but for future references you can now just use getRowStyle(params). I believe in your case you would use it like:

gridOptions.getRowStyle = function (params) {
    return params.data.isBold ? {"font-weight":"bold"} : null;
}

This assumes the isBold column you mention has its values as booleans (true & false). Else you just need to change the condition.

To hide the column you just don't put its colDef with the others, and that will simply not render it but you will still have access to the data contained in it (like here above).

tfrascaroli
  • 1,178
  • 1
  • 14
  • 26