androidmj, I could never have done this without you!
However, your code does not push the changes to fixed cells. With some changes, I was able to get it to work.
I have a table in which the 5th column (remember that HandsOnTable starts counting columns from 0) contains the delivery method. If the delivery method is UPS, I want to highlight the entire brown line.
Create Renderers
There are only 5 types of rendering in HandsOnTable, and I missed the password renderer because I don't use it. See https://github.com/handsontable/handsontable/blob/master/src/cellTypes.js for reference.
Notice that I have hardcoded column 5 in each renderer as a place for the contents of the cell that I am testing.
In addition, I find it important to note that with the help of another if statement, you could do additional checking here. For example, I can check column 3 for “On Credit retention” and highlight the red line.
var highlightingAutocompleteRenderer = function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.AutocompleteRenderer.apply(this, arguments); if($('#hot').handsontable('getDataAtCell',row, 5) == 'UPS'){ td.className = 'UPS'; } }; var highlightingCheckboxRenderer = function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.CheckboxRenderer.apply(this, arguments); if($('#hot').handsontable('getDataAtCell',row, 5) == 'UPS'){ td.className = 'UPS'; } }; var highlightingNumericRenderer = function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.NumericRenderer.apply(this, arguments); if($('#hot').handsontable('getDataAtCell',row, 5) == 'UPS'){ td.className = 'UPS'; } }; var highlightingTextRenderer = function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.TextRenderer.apply(this, arguments); if($('#hot').handsontable('getDataAtCell',row, 5) == 'UPS'){ td.className = 'UPS'; } };
Create your columns
Notice that I set the renderer for each column. The viewer checks the correct column for the specified text.
columns: [ {type: 'date', renderer: highlightingAutocompleteRenderer}, { type: 'text', renderer: highlightingTextRenderer}, {type: 'autocomplete', source: ["aaaaa","bbbbb","ccccc","ddddd"], renderer: highlightingAutocompleteRenderer}, { type: 'dropdown', source: ["Cancelled","Complete","Finished","On Credit Hold","In Production"], renderer: highlightingAutocompleteRenderer}, {type: 'numeric', renderer: highlightingNumericRenderer}, {type: 'dropdown', source: ["Common Carrier","Customer Pickup","Delivery Truck","UPS"], renderer: highlightingAutocompleteRenderer}, ]
CSS
You probably know how to create CSS, but it doesn't matter here.
.UPS { background-color: #644117; color: white; font-weight: demi-bold; }
What it is - now every column in the row sent by UPS highlights brown.