I have a custom grid that is displaying a single record at a time (Pagination set to 1). The cell has a section that displays the fields.
In the Action Bottom, I have a custom grid paginator (works fine) and a button that on click will Add Item, Refresh List, then paginate to the end of the list using a doGridAction specifying script:event, "PAGINATE", "", "last", "","", "true". This doesn't work (no errors)
In the doGridAction (pzPega_ui_grid.js) script, at the bottom of function gridPagination, I see a step to search for the actionAncestor and it passes the resulting elements class name to the next function (reloadGridLayout) to set focus after reloading the grid.
When I use my custom paginator to go through the records (doGridAction - "next"), actionAncestor holds a value.
When I use my Add button, it is null. I suspect because the immediate ancestor of my button is a span with no class. Thus the script breaks and never calls the reload function. If I pass null in place of the "focusParams" to reloadGridLayout(), it works as expected.
***Edited by Moderator Marissa to update categories; update SR details***
Shouldn't the pega.util.Dom.getAncestorBy return the same gridActionBottom div as in case of the paginator as they are in the same action bottom area? Have you checked why it is not returning the correct element in case of the button?
I would think so but I've followed the code as far as i could find (couldn't find source for getAncestorBy function). In the case of the paginator, it returns the Icon class which is the direct ancestor of the action event. In the event of the button, it returns undefined.
It's happening probably because the refresh list action makes the button stale, i.e. replaces with a newly constructed button. In your case, why is a refresh list required? Won't pagination kind of refresh the list?