195
Views
4
Comments
Solved
[OutSystems Data Grid] ExternalEvents is not defined.
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi, according to Does DataGrid support changeing the editable properties of a single, in order to solve this, I used a JS node in OnReady Event. However, after we updated the latest version, [ExternalEvents is not defined.] error occurred.

Could you help me solve this problem?

Kind regards.


6AEA6D138AF74941924D455BB889BFAC.png
2020-08-31 15-57-57
Tiago Miguel Pereira
Staff
Solution

Hello @He Caixia,

On your DataGridOnInitiliaze, you don't need to use the Subscribe. That Event OnInitialize from DataGrid that you marked with a border on the first image will do the Subscribe for you. All you need to do inside your JS block (second image) is the line of code:


const beginEdit = function(){...}
GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider.beginningEdit.addHandler(beginEdit);

Can you confirm if this works?

Best regards,

Tiago Pereira

2020-08-31 15-57-57
Tiago Miguel Pereira
Staff

Hello @He Caixia,

Thanks for bringing this subject to the discussion.

One of the new implementations that the new version (2.2.0) brought to the community was an OnInitialize event that can be accessed directly in the events of the Data Grid Block.

You can learn more about this event in our documentation.

Please let me know if that works for you.

Best regards,

Tiago Pereira 

2022-04-01 10-05-06
He Caixia

I have used the OnInitialize method of datagrid and put the JS in OnInitialize, but it still throws an error message:[ExternalEvents is not defined.] 


2020-08-31 15-57-57
Tiago Miguel Pereira
Staff
Solution

Hello @He Caixia,

On your DataGridOnInitiliaze, you don't need to use the Subscribe. That Event OnInitialize from DataGrid that you marked with a border on the first image will do the Subscribe for you. All you need to do inside your JS block (second image) is the line of code:


const beginEdit = function(){...}
GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider.beginningEdit.addHandler(beginEdit);

Can you confirm if this works?

Best regards,

Tiago Pereira

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.