Hello guys,
is it possible to get the current row data where the rightclick was executed (the row is NOT selected!)?
and can i add dynamic items (with on click action) to the context menu before the context menu is showing?
Thank you
Hi @NITHIN ARADHYA,
You can use the following pieace of code to get the current selected rows:
OutSystems.GridAPI.Selection.GetAllSelections($parameters.GridId);
If any row is selected, it will return the topRowIndex and bottomRowIndex as well as the column indexes corresponding to the selection.
Cheers,
Giuliana.
Hi @AndiK,
Thanks for reaching us.
You can add items to your context menu on your grid. To add the reported behavior to right click, with just need to use the block MenuItem_CustomOption of the Grid and on the event "ClickEvent" use a JS node with this API: GridAPI.Rows.GetRowData(gridID, rowNumber). You need to pass the GridId and the RowNumber. Check the image below:
Please check if this works for you.
ThanksBruno Marcelino
I tried the way you suggested as above but it didn't work MenuItem_CustomOption was added and handler was connected for Click event but it wasn't triggering the action . The main ask is row number not the trigger I can trigger the click event by using below piece of code in JS . The main ask is to get the row id or number on click through js would be great because the column data and row data we are getting from backend
it worked thanks