Posted: 5 May 2016 4:17 EDT Last activity: 28 Feb 2017 3:54 EST
Is there a way to bring a row in grid layout into focus ?
I have a grid layout with scroll bar enabled (by default a fixed number of rows displayed). The requirement is to bring a row ( based on a condition ) into focus so that it is highlighted and visible to the user on load of the screen. The row that we need to bring into focus may not always be the displayed by default ( i.e., may not be within the fixed number of records). Do you know if there is a way to programmatically bring a row into focus ?
Thanks in advance for your help.
Message was edited by: Marissa Rogers - Added Category
Could you please share more details of your use-case. Is it like you want to focus a record which is still not visible on screen?
If that is the case, then I am afraid bringing focus to that element may introduced some unexpected results. Instead, you may take the below suggestion into consideration.
Approach 1:- Sort the records on the grid in such a way that the concerned record will always be the first record of the grid. Then on load of the screen, you may always focus the first element on the grid.
Approach 2:- Create a separate CSS class and apply it on the concerned record conditionally.
Please let me know, if anyone of the above approach could be helpful in your use-case.
We made changes to the column headers of the repeat grid to information in the record to be highlighted (copied over to a page property) using <pega:reference> tag along with displaying labels of column headers. This way column headers are displayed in one row, followed by record to be highlighted and then the grid layout without impacting any sorting functionality.