How to add a new row in last in Data Grid in Reactive App.
I am using forge component DataGrid
I am using data grid client action add row on a click of a button
but instead of adding row in the last it adding new row above
but i want it to add row in the last of the grid
how can i do that
Hi Sourabh,
For your requirement, I found a solution (not tested thoroughly) which you can try.
JS To add DataGrid Bottom row
var gridObj = GridAPI.GridManager.GetGridById($parameters.GridId); var items = new Array(1).fill(_.cloneDeep({})); if (gridObj) { gridObj.dataSource.addRow(gridObj.rowMetadata._grid.rows.length + 1, items); }
Check this demo: AddBottomRow_POC
I hope this helps you!
Kind regards,
Benjith Sam
Thank you
sir oml is not downloading properly can you
share it again please
I'm able to download the previous attachement don't know what went wrong. Anyways, refer to the attached oml.
Currently there's no simple way to achieve this. If this is an important feature for your project I suggest duplicating the OutSystems Data Grid extension and then try to adapt the AddNewRows function to meet your needs, you will find this function in the Gridframework JS file.
Hope it helps.
@Benjith SamHi BenjithUsing the JS, the added row on the bottom is not marked as dirty. How to make it as dirty mark ?Thank you,Itqon