oracle-databaseoracle-apexoracle-appsoracleapplications

Select all checkbox of interactive grid only selects the rows that have already been rendered?


I have long list of rows in interactive grid. As I scroll down, the grid loads more rows. The select all checkbox on top only selects the rows that have been rendered in the view. Is there a way to select rows that have not been rendered yet? or Is there an event that gets fired when loading is complete?


Solution

  • There is no event that occurs when the last page of results is loaded.

    You can detect if the last page has been loaded using this undocumented / unsupported method:

    var g = apex.region("emp").call("getViews","grid");
    if (g.model._haveAllData) {
        // all the rows are now shown
    }
    

    To load an additional page of results:

    g.view$.grid("lastPage");
    

    Note: don't do what I did and try to put these in a simple Javascript loop - this fails because the loop wouldn't wait until each page is loaded before trying to load another.

    An approach I might take if the number of records is expected to be <1000, is to change the pagination to Page, and the number of records per page to 1000. That way you know they'll all be loaded initially.