Skip to main content
Solved

Override gridConfig in type script extention

  • October 27, 2026
  • 4 replies
  • 20 views
  • Translate All

I have a typescript extention that correctly adds a new action to the item view in AR301000. The action should only be enabled depending on certain criteria for each ARTran line on the invoice.

 

I have read the examples for the @updateDecorator which I understand is the correct way to update an existing decorator in an extention.

 

I have added the following to my extention of the ARTran view:

import { PXActionState, updateDecorator } from "client-controls";

import { ARTran } from "src/screens/AR/AR301000/AR301000";

export interface AR301000_MyExt extends ARTran { }

@updateDecorator("gridConfig", "syncPosition", true)
export class AR301000_MyExt {
AssignOptions: PXActionState;
}

The action is displaying but the RowSelected event in the GraphExtention is not being called. 

I have also tried with a delegate as follows:

import { PXActionState, updateDecorator } from "client-controls";

import { ARTran } from "src/screens/AR/AR301000/AR301000";

export interface AR301000_MyExt extends ARTran { }

@updateDecorator("gridConfig", (config) =>{
config.syncPosition = true;
return config;
})
export class AR301000_MyExt {
AssignOptions: PXActionState;
}

Same result, the RowSelected events ar enot fired.

I’ve obviously missed something any help would be greatly appreciated.

Best answer by Steve Milner

@jumble0470 Daryl's fix is the first half. On 26 R1 the build only pulls an extension file into the screen when that file also extends the screen class. I published your file as posted on a 26 R1 test site, and it never made it into the AR301000 bundle, so neither decorator ran. The button still showed, because the server side reads the file even though the browser never loads it.

Once the file loads, the syncPosition override still won't change anything. The ARTran grid uses GridPreset.Details, and that preset already sets syncPosition: true. syncPosition only sends the active line's key along with the next request. Clicking another line doesn't call the server, so your RowSelected never runs and the button keeps its old state.

Dipak's autoRepaint is the setting that makes the grid call back when the active line changes. It takes a list of view names, and the one to use is ["ScreenToolbar"]. Naming the grid's own view (["Transactions"]) reloads the grid on every click, and the selection jumps back to line 1. With the code below, each line click made one round trip, RowSelected ran with Transactions.Current on the clicked line, and the button enabled and disabled line by line. It worked whether the handler checked e.Row or Transactions.Current.

```
import { PXActionState, updateDecorator } from "client-controls";
import { AR301000, ARTran } from "src/screens/AR/AR301000/AR301000";

export interface AR301000_MyExt extends AR301000 { }
export class AR301000_MyExt { }

export interface ARTran_MyExt extends ARTran { }
@updateDecorator("gridConfig", "autoRepaint", ["ScreenToolbar"])
export class ARTran_MyExt {
    AssignOptions: PXActionState;
}
```

Your delegate version had its own problem. The signature is updateDecorator(decoratorName, innerPath, config), so your function landed in the innerPath slot.

View original

4 replies

Dipak Nilkanth
Pro III
Forum|alt.badge.img+14

Hi ​@jumble0470, Have you tried adding autoRepaint: true inside your @gridConfig decorator?

Translate

darylbowman
Captain II
Forum|alt.badge.img+17

Decorators don’t get picked up in extensions unless the original screen class is extended.

Try this:

import { PXActionState, updateDecorator } from "client-controls";

import { AR301000, ARTran } from "src/screens/AR/AR301000/AR301000";

export interface AR301000_MyExt extends AR301000 { }
export class AR301000_MyExt { }

export interface ARTran_MyExt extends ARTran { }
@updateDecorator("gridConfig", "syncPosition", true)
export class ARTran_MyExt {
AssignOptions: PXActionState;
}

 

Translate

Steve Milner
Varsity III
Forum|alt.badge.img+6

@jumble0470 Daryl's fix is the first half. On 26 R1 the build only pulls an extension file into the screen when that file also extends the screen class. I published your file as posted on a 26 R1 test site, and it never made it into the AR301000 bundle, so neither decorator ran. The button still showed, because the server side reads the file even though the browser never loads it.

Once the file loads, the syncPosition override still won't change anything. The ARTran grid uses GridPreset.Details, and that preset already sets syncPosition: true. syncPosition only sends the active line's key along with the next request. Clicking another line doesn't call the server, so your RowSelected never runs and the button keeps its old state.

Dipak's autoRepaint is the setting that makes the grid call back when the active line changes. It takes a list of view names, and the one to use is ["ScreenToolbar"]. Naming the grid's own view (["Transactions"]) reloads the grid on every click, and the selection jumps back to line 1. With the code below, each line click made one round trip, RowSelected ran with Transactions.Current on the clicked line, and the button enabled and disabled line by line. It worked whether the handler checked e.Row or Transactions.Current.

```
import { PXActionState, updateDecorator } from "client-controls";
import { AR301000, ARTran } from "src/screens/AR/AR301000/AR301000";

export interface AR301000_MyExt extends AR301000 { }
export class AR301000_MyExt { }

export interface ARTran_MyExt extends ARTran { }
@updateDecorator("gridConfig", "autoRepaint", ["ScreenToolbar"])
export class ARTran_MyExt {
    AssignOptions: PXActionState;
}
```

Your delegate version had its own problem. The signature is updateDecorator(decoratorName, innerPath, config), so your function landed in the innerPath slot.

Translate

  • Author
  • Freshman II
  • October 28, 2026

Thanks All

​@Steve Milner your answer worked a treat thanks. 

Translate