I have searched for the similar problem in the Internet and the Community but haven't found a solution. Please help.
My Problem/Issue:
I have an interactive grid developed in APEX 19.1 as an editable interactive grid as shown below:
| Completion Date | Activity Date | Activity Description | Status | Notes | Activity Owner |
| | 09-Sep-2019 | Send draft to Pat and Jan for review | | | Owner A |
| | 16-Sep-2019 | Draft approved and sent to Amy for Company's Communications approval | | | Owner A |
| | 07-Oct-2019 | Post in Welcome Center | | | Owner A |
If I change the Activity Owner from Owner A to Owner B (for example in the third row), it pops up an inline dialog that looks like below:
If the button NO is clicked, it will do nothing and go back to the row where the change is done (for example in the third row). I have a dynamic action that is shown below.
The first Execute Java script code; closeModal('mod');
The second Execute Java script code is:
var myGrid = apex.region( "newgridID" )
.widget()
.interactiveGrid("getViews")
.grid
.focus();
myGrid.model.fetchRecords( myGrid.getSelectedRecords() );
When I click "NO", it is doing what I wanted to do (i.e. going back to the row where the change occurred - third row) but I am getting "Uncaught TypeError: Cannot read property 'model' of undefined" from a javascript in a dynamic action. It shows on the console.

I am using Apex 19.1. I don't know too much of javascript and I don't know how to debug. I copied the codes from one internet site.
I appreciate it if someone helps resolve this issue for me.
Thank you very much in advance.
jcaye