Here is my data structure:

The spanning in ag-grid works correctly for columns 1 and 2 (spanning code below). What I am trying to do is alternate colors based on column 2 (animal). So all rows for dog would be one color. All rows for cat would be another, etc. Does anyone know how I can achieve this? I have see examples online for alternating all row colors, but not for alternating entire row groups like the above. Below is my row spanning javascript code if it helps.
dagfuncs.rowSpanning1 = function (params) { var lid = params.data ? params.data.sort1 : undefined; if (lid === 1) { return 3; } else { return 1; } }
dagfuncs.rowSpanning2 = function (params) { var id1 = params.data ? params.data.sort2 : undefined; if (id1 === 1) { return params.data.sortx; } else { return 0; } }
Источник: https://stackoverflow.com/questions/780 ... r-row-span
Мобильная версия