Setting focus to a previously selected row in IG after Page Submit
1) Create a dynamic action on "selection change (interactive grid)"
The true action is "execute javascript code"
//set the static id field on your interactive grid and put the value on gridID variable
var gridID = "dept";
var ig$ = apex.region(gridID).widget();
var grid = ig$.interactiveGrid("getViews","grid");
var selectedRecord = grid.getSelectedRecords();
console.log(selectedRecord);
localStorage.setItem('lastSelectedRecord', JSON.stringify(selectedRecord));
2 - Create a dynamic action on "page load"
//set the static id field on your interactive grid and put the value on gridID variable
var gridID = "dept";
var ig$ = apex.region(gridID).widget();
var grid = ig$.interactiveGrid("getViews","grid");
grid.setSelectedRecords(JSON.parse(localStorage.getItem('lastSelectedRecord')));
Comments
Post a Comment