I am using Apex 5.1.1
I have an interactive grid to which I have added four buttons. Each button triggers an event which then executes a dynamic action.
The buttons then determine which columns are displayed.
The reason for doing this is when a user has found the row of data they want, possibly from a long list with some scrolling, I want them to be able to remain viewing that record, and those nearby, but change which fields they see, as we have too many to helpfully see on the page at one go. If we had different saved reports it would reset the pagination so they would loose what they are were seeing.
So I can hide columns individually using
function hideCol(colname) {
if (isHidden(colname) === false) {
apex.region("my_ig").widget().interactiveGrid("getViews", "grid").view$.grid("hideColumn",colname);
}
}
I can show columns using
function showCol(colname) {
if (isHidden(colname) === true) {
apex.region("my_ig").widget().interactiveGrid("getViews", "grid").view$.grid("showColumn",colname);
}
}
This works, however the performance is not great because of the number of columns we are hiding and showing. I have looked and found that hideColumn and showColumn do a _refreshGrid every time. This means if I am hiding and showing multiple columns, the grid gets refresh multiple times. We probably have a total of about 60 columns, so we are hiding roughly 40 of them each time, and showing the remaining 20, however each button determines that different "sets" of columns are shown.
Is there a way to hide/show multiple columns and then do one refresh grid without doing a refresh grid for each hide/show operation? I am hoping this would then improve the performance of the page when the buttons are pushed.
Any help gratefully received.