Set Focus new line

By default, Epicor auto-focuses on the part field when you create a new line. I’m working on a custom layer and somewhere along the way I lost this default functionality.
I want to get this functionality back, but I’m struggling.

focus (default)

no focus (the problem, which I’ve caused :sweat_smile:)

I’ve tried the control-focus-set without much luck.
I’ve tried to set the focus on a specific column after GetNewOrderDtl (or something like that).
control focus set

Does anyone have any advice they can give?
Any thoughts on what I should try next?

Didn’t figure out how to set/force the focus, but I did learn my issue was with a setting on the grid itself.

metafx-panel-card-grid > Grid Model > Row Reorder
I had to uncheck Reorder Rows.
image

Thank you @huyen !!

1 Like

Did you find any solution for setting focus for field in the grid?

No, I didn’t end up needing to set the focus, but I would hope its possible :crossed_fingers:
I know we use that control-focus-set widget to set focus on form fields, so it does work in some capacity.

But can it be used on a grid? I don’t know.
Maybe if you target a specific row using the dataview’s “viewRow” in conjunction with a specified column you can target the next grid cell?

I have tried the things you’ve mentioned but without success. I don’t think it’s possible to achieve with standard tools. At least not in 2022.22.41.
I found another “hacky” way of doing that but it has one disadvantage.

I find the control and perform click event on it.

querySelector('string-to-find-your-control').click();

The disadvantage I found is that it works only once. Once it run it seems that all other events are not working.

2 Likes

giphy