Skip to main content
Solved

Modern UI: Grid Row/Cell focus highlighting not working when custom row CSS is applied

  • May 29, 2026
  • 4 replies
  • 49 views

MichaelShirk
Captain II
Forum|alt.badge.img+6

What am I doing wrong here? 

I have an inquiry screen with custom grid row colors depending on Production Order Status. The style is being applied, but there is no more slight color change to indicate the current focus/selected row/cell. See the GIFs. 

With GetRowCss custom highlighting

 

Without custom highlighting

 

import { Messages as SysMessages } from "client-controls/services/messages";
import { createCollection, createSingle, PXScreen, graphInfo, PXPageLoadBehavior, handleEvent, CustomEventType, RowCssHandlerArgs, CellCssHandlerArgs } from "client-controls";
import { SWProdPlannerLineFilter, SWProdPlannerLineView } from "./views";

@graphInfo({ graphType: "PVBMFGCustomizations.SWProdPlannerInq", primaryView: "Filter", pageLoadBehavior: PXPageLoadBehavior.PopulateSavedValues })
export class SW401010 extends PXScreen {

Filter = createSingle(SWProdPlannerLineFilter);
Details = createCollection(SWProdPlannerLineView);

@handleEvent(CustomEventType.GetRowCss, { view: 'Details'})
getDetailsRowCss(args: RowCssHandlerArgs): string | undefined {
const row = args?.selector?.row;
if (!row) return undefined;

const statusID = row.StatusID?.value;

switch (statusID) {
case 'H': // Hold
return 'red';
case 'P': // Planned
return 'red40';
case 'R': // Released
return 'blue40';
case 'I': // InProcess
return 'green40';
case 'X': // Cancel
return 'yellow40';
case 'M': // Completed
return 'green';
case 'C': // Closed
return 'purple40';
case 'L': //Locked
return 'purple60'
default:
return undefined;
}
}


}

The html 
 

<template>

<qp-template id="Filter_PXLayoutRule1_div0" name="1-1-1">
<qp-fieldset id="Filter_PXLayoutRule10_fs" wg-container="Filter_form" view.bind="Filter" slot="A">
<field name="SiteID"></field>
</qp-fieldset>


</qp-template>

<qp-grid id="grid" view.bind="Details"></qp-grid>

</template>


Can someone point me to a solution/documentation for this? 


Thank you!

Best answer by Samvel Petrosov

As an option try doing this. Define your highlight color code in a .css file

.CUSTOMCLASS_1{

    background-color: #8080806b !important;

    color: #2c2a2a96 !important;

}


.CUSTOMCLASS_2{

    background-color: #8080806b !important;

    color: #2c2a2a96 !important;

}

make sure you have the require in the html

<require from="./SW401010.css"></require>

Then change your event handler to use your custom css classes 

@handleEvent(CustomEventType.GetRowCss, { view: "Details" })

getDetailsRowCss(args: CellCssHandlerArgs): string | undefined {

    if (SOME_CONDITION) {

        return "CUSTOMCSSCLASS_1";

    }

    return "CUSTOMCSSCLASS_2";

}

I have this in one of my projects and it seems to work with the out-of-the-box line highlight just fine.

4 replies

Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

Do you have to change the highlight of the whole row?

I would guess there is a priority conflict, and your change has a higher priority than the default highlight.

I suggest using the status cell-level highlight instead if that is acceptable for your use case.


MichaelShirk
Captain II
Forum|alt.badge.img+6
  • Author
  • Captain II
  • May 29, 2026

@Samvel Petrosov  I may have to do it that way. 

But this is how it was working on the Classic UI. The focus highlighting wasn’t super visible for some colors, but it was enough to see which row was selected.

 


Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

As an option try doing this. Define your highlight color code in a .css file

.CUSTOMCLASS_1{

    background-color: #8080806b !important;

    color: #2c2a2a96 !important;

}


.CUSTOMCLASS_2{

    background-color: #8080806b !important;

    color: #2c2a2a96 !important;

}

make sure you have the require in the html

<require from="./SW401010.css"></require>

Then change your event handler to use your custom css classes 

@handleEvent(CustomEventType.GetRowCss, { view: "Details" })

getDetailsRowCss(args: CellCssHandlerArgs): string | undefined {

    if (SOME_CONDITION) {

        return "CUSTOMCSSCLASS_1";

    }

    return "CUSTOMCSSCLASS_2";

}

I have this in one of my projects and it seems to work with the out-of-the-box line highlight just fine.


MichaelShirk
Captain II
Forum|alt.badge.img+6
  • Author
  • Captain II
  • May 29, 2026

Yeah I was hoping to do this without writing my own CSS, but that will probably be the smartest Idea.