Oracle Apex Cards Region Pagination

299 views Asked by At

I've been playing around with the Cards region in APEX. When the page is loaded, can we manipulate and land on a specific card position of a paged card region?

For example:

We have page 1 in the application where all cards are displayed. Cards are too many, so we have paged the cards region to display only 32 on a single page and the rest of the cards on subsequent pages, 32 cards on each page. This creates a numbering with arrows at the bottom of the region (As shown in the image below) so the user can navigate between paged cards.

enter image description here

We have page 11 where we display detailed information about a card. Users can click a card on page 1 and go to page 11. There is a button on page 11 that brings the user back to page 1.

Now if the user clicks card # 65 to go to the card details page which is page 11, as per our pagination when a user comes back to the cards page which is page 1, that page will reset the pagination and the user will be seeing the first 32 cards rather be on card # 65.

Can there be any possibility that we can manipulate the data from apex tables to land the user on card # 65 which he clicked initially to go to the details page?

1

There are 1 answers

2
davidm On BEST ANSWER

You can do it with the JS API and some additonal logic:

// go to first page
apex.region('your_static_id').call('firstPage');

// go to last page
apex.region('your_static_id').call('lastPage');

// go to first page
apex.region('your_static_id').call('gotoPage', 0);

// go to second page
apex.region('your_static_id').call('gotoPage', 1);

The docs here.