I want to add color to order grid on magento2.4 admin panel, sales -> orders. Each status should have own color, forexample status "complete" shows purple and all rows who has complete status become purple
2 Answers
Please add custom js file in sales_order_index.xml file and to color completed order grid row as per the value,I have written below code in js file :
require(["jquery"], function($){
$(document).ready(function ()
{
var i = setInterval(function ()
{
if ($('.data-grid-cell-content').length)
{
//clearInterval(i);
$('.data-grid-cell-content').each(function(i, obj) {
var classStatusName = $(this).text();
if (classStatusName == "Complete")
{
$(this).closest('tr').addClass("class-purple");
}
});
}
}, 100);
});
});