JSFiddle - React, Tailwind, and code Playground
by Vignesh Gopalakrishnan
JavaScript
let formattedRowId = "0CS9TRN9GC000000000000010VISIBLE0007RAGStatus";
let rowToBeFormattedId = "0CS9TRN9GC000000000000010VISIBLE0006YTDFeb / Latest";
let allRows = $('.ag-center-cols-clipper .ag-center-cols-viewport .ag-center-cols-container')[0].children;
for (eachRow of allRows) {
let formattedRow = null,
rowToBeFormatted = null;
for (eachCol of eachRow.children) {
if (eachCol.attributes['col-id'].value == formattedRowId) {
formattedRow = eachCol.style.backgroundColor;
} else if (eachCol.attributes['col-id'].value == rowToBeFormattedId) {
rowToBeFormatted = eachCol;
}
}
if (rowToBeFormatted && rowToBeFormatted.style) rowToBeFormatted.style.backgroundColor = formattedRow;
}