I know of two ways to accomplish this:
- Enable
SyncPositionon the grid which will trigger theRowSelectedevent in the graph - Use the TypeScript
CurrentRowChangedevent
Here’s the problem: all the examples in the docs are for base screens, not customizations. I need to do this for an existing grid without SyncPosition enabled.
I tried defining it in an extension of the original class:
@gridConfig({
syncPosition: true
})
export class DXCostBudgetExt extends CostBudget {This didn’t seem to change anything.
I also tried to write a TypeScript event handler for CurrentRowChanged, but again, the docs only specify how to do this with the base class, not an extension class. I tried several variations of this, and nothing seems to work:
@handleEvent(CustomEventType.CurrentRowChanged, { view: "CostBudget" })
onCostBudgetLineChanged(args: CurrentRowChangedHandlerArgs<PXViewCollection>) {
const ar = args.viewModel.activeRow as DXCostBudgetExt;
//const model = (<any>args.viewModel as CostBudget);
if (ar.UnlinkPO) {
ar.UnlinkPO.enabled = !!ar?.UsrPDPONbr?.value;
}
}