Hi.
When Saving data, if there is any invalid data, I would like to inform the user of the corresponding row. Therefore, I would like to get the RowNumber, but I cannot get it with GetChangedLines. How can I do this?
Regards,
Haruka
Hi @Haruka Arakawa
You can add an event handler to manage and store or do whatever you need with the focused cell by using the following code in a JSNode in Grid’s OnInitialize event handler:
var myGrid = OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider; myGrid.selectionChanged.addHandler(function (s, e) { // Get the selected cell's row index var selectedRowIndex = myGrid.selection.row; // Use the rowNumber here with your logic console.log('Selected Row Index:', selectedRowIndex); }); //where $parameters.GridWidgetId is the identifier of the Data Grid block
I hope it helps!
Cheers,GM
Hi Haruka,
You can create a handler for OnCellValueChange, it will give you the row number.
Hope it helps,
Thanks
Hi Jozy,
Thank you!
However, it looks like we can't use OnChange on a checkbox column, because our app grid needs to save all the rows that have changed, not just any row that has been checked.
Is there any other way, JavaScript or otherwise, besides OnChange, to get the number of the row where the change was made?