Hello,
We are using the UI igGrid where we are listing orders (see screen caption). The user can either click on the View or Edit button which opens up a new browser window/tab where the order can be modified and saved (including the order status). What we want to do is when the browser window that the order list is on gets the focus again we would like to reload the page so that the order record that was just modified is refreshed with the updated order status and selected so that the user remembers which order they just modified was (for example Order 48842 as the illustration shows). How can I get the grid to select the row again and have the page post when the browser window gets the focus again.
Thanks!
Hello Richard,
I am glad my suggestion was helpful and you were able to achieve your requirement.
Thank you for using Infragistics components.
Regards, Monika Kirkova, Infragistics
Thank you that did it.
After investigating further, I have determined that the localStorage saves the pageIndex as string and not as integer. Because of this when the pageIndex is set, the buttons don’t have the active state classes applied. If the pageIndex variable is converted to int, the current page button would have the correct classes.
let pageIndex = parseInt(localStorage.getItem("currentPage"));
$("#grid").igGridPaging("pageIndex", pageIndex);
Please test it on your side and let me know if you need any further information regarding this matter.
Thank you Monika.
That seems to work just fine.. one last think when the page index changes i would like the page navigation at the bottom or the grid to indicate the current page.. right now changing the page index as you provided does not do that. Please advise.. see attached
Thank you again.
The current page index of the grid could be accessed and set by using the pageIndex method:
localStorage.setItem("currentPage", $("#grid").igGridPaging("pageIndex"));
. . .
let pageIndex = localStorage.getItem("currentPage");
Additionally, more information regarding options and methods of the igGrid could be found here.