93
Views
2
Comments
[Data Grid] How can i create button with Insert New Row function of DatGrid.
Forge component by OutSystems R&D
41
Published on 13 Oct 2020

Hello,

I know DataGrid have the InsertNewRow function when you right-click on the table, but i need to add button with the same functionality and i can´t figure it out. Hope you can help me

Thank you.

Rank: #45

Oleksandr Danilov wrote:

Hello,

I know DataGrid have the InsertNewRow function when you right-click on the table, but i need to add button with the same functionality and i can´t figure it out. Hope you can help me

Thank you.


Hi Danilov,

I dont think you can achieve this by DataGrid component.
You have to customize in your case

Staff
Rank: #6438

Hi Oleksandr Danilov,

You can achieve this by our ExternalAPI, to add new rows use the method bellow:

GridOS.ExternalAPI.addRow({}, 0, '" + Grid.Id + "');

Parameters:

  • 1st: Datasource for the new row, in this case I pass a blank source
  • 2nd: the Index on where the new row will be placed
  • 3rd: The Id of the Grid, as you can have more than one grid on the same page you need to specify the which Grid you want to handle 

There is a sample attached, hope it can help you achieve your goals.

Regards

Ricardo Valim


 

DataGridButtonAddRow.oml