Highlight rows

You can highlight rows with different colors by matching a specific set of conditions

To highlight a row you need to use the $highlight array

$highlight = array();

Then on each value you need to add the following information separated with commas:

  • Column Name
  • Conditional Operator
  • Value
  • Color (use a CSS color without commas; rgba() conflicts with the legacy delimiter)
  • Title of the selection
array_push($highlight,'PURCHASE_DATE,<,2020-01-01,RED,Before January 2020');
array_push($highlight,'PURCHASE_DATE,>=,2020-01-01,GREEN,After January 2020');
array_push($highlight,'PURCHASE_DATE,==,2020-01-01,GREEN,After January 2020');

Version availability: Structured rules require the current KAS Core prepared in update 158. Install that Core version before using this format; the update remains unpublished.

Highlight Table View rows

table_view.php applies $highlight after rendering rows and builds the native clickable legend. Use structured equality rules when labels/colors come from database records:

$highlight = [[
    'column' => 'CATEGORY_ID', 'value' => 12,
    'color' => '#329465', 'title' => 'Preferred category'
]];

The example ID/color are illustrative; query the actual lookup table to construct dynamic rules. Include the condition column and the primary key in the Table View query. Structured rules compare non-null row values to the rule value as strings. They accept six-digit hexadecimal colors only; invalid colors or incomplete rules are skipped. They do not evaluate PHP expressions. Titles use JSON-safe JavaScript and text nodes in the legend, so quotes, commas and HTML-like text remain literal. No matching rule leaves the normal row appearance. If rules overlap, the later matching rule supplies the row's final style.

Existing comma-separated strings remain compatible: COLUMN,operator,value,color,title. They use the older eval-based comparison path; keep them developer-owned. Commas in rgba()/titles conflict with this format. Prefer structured rules for equality and database text. The structured format does not accept an arbitrary operator.

Live fields save through their native handler. Highlighting reflects the row values at render time: reload after a live category change to show the new color. Legend entries appear only for rules matching displayed rows; SHOW ALL resets legend selection.