๐Ÿš€ Implementing โ€œShow Moreโ€ Button in Interactive Grid in Oracle APEX

๐Ÿš€ Implementing โ€œShow Moreโ€ Button in Interactive Grid in Oracle APEX

Interactive Grid is one of the most powerful components in Oracle APEX, widely used for displaying and managing large datasets.

By default, Interactive Grid uses pagination, which can sometimes impact user experienceโ€”especially when users prefer scrolling instead of switching pages.

In this blog, weโ€™ll learn how to replace traditional pagination with a โ€œShow Moreโ€ (Load More) button, allowing users to load data dynamically.


๐ŸŽฏ What You Will Achieve

After implementing this solution:

โœ… Users can load more records with a single click

โœ… No need to navigate between pages

โœ… Improved user experience for large datasets

โœ… Cleaner and modern UI


๐Ÿงฐ Tools & Technologies

  • Oracle APEX
  • JavaScript
  • Interactive Grid

๐Ÿ’ผ Business Requirement

In many enterprise applications:

  • Users work with large datasets
  • Pagination becomes tedious
  • Users prefer continuous scrolling or incremental loading

For example:

๐Ÿ‘‰ Employee listing screen

๐Ÿ‘‰ Order management dashboard

๐Ÿ‘‰ Inventory data grid

Instead of clicking โ€œNext Pageโ€, users should be able to:

โžก Click โ€œShow Moreโ€

โžก Load additional records instantly


โš™๏ธ Step-by-Step Implementation


Step 1๏ธโƒฃ Create Interactive Grid

Create an Interactive Grid based on your table (e.g., EMP).


Step 2๏ธโƒฃ Add Static ID

Go to:

Region โ†’ Advanced โ†’ Static ID

Set a Static ID (optional but recommended):

emp_ig

Step 3๏ธโƒฃ Add Initialization JavaScript Code

Navigate to:

Attributes โ†’ Advanced โ†’ JavaScript Initialization Code

Add the following code:

function( options ) {
    options.defaultGridViewOptions = {
        pagination: {
            loadMore: true
        },
        rowsPerPage: 5
    };
    return options;
}

๐Ÿง  Code Explanation

๐Ÿ”นย loadMore: true

  • Enables โ€œShow Moreโ€ button
  • Replaces traditional pagination
  • Loads additional records dynamically

๐Ÿ”นย rowsPerPage: 5

  • Defines how many rows to load initially
  • Each click on Show More loads the next set of rows

๐Ÿ‘‰ You can increase this value based on performance needs.


๐Ÿ–ฅ๏ธ How It Works

Initial Load

  • Only 5 records are displayed

When User Clicks โ€œShow Moreโ€

  • Next 5 records are loaded
  • Data keeps appending to the grid

๐ŸŽจ UI Behavior

Traditional Pagination โŒ

โฌ‡

Modern Load More Button โœ…

This creates a smooth and app-like experience.


๐Ÿ’ก Use Cases

This feature is very useful in:

  • ๐Ÿ“Š Reporting dashboards
  • ๐Ÿ›’ Product listings
  • ๐Ÿ“ฆ Inventory systems
  • ๐Ÿ‘จโ€๐Ÿ’ผ Employee directories
  • ๐Ÿ“‘ Audit logs

โšก Pro Tips

โœ” Use smaller rowsPerPage for better performance

โœ” Combine with Lazy Loading for large datasets

โœ” Avoid loading too many records at once

โœ” Test performance for large tables


๐Ÿš€ Advanced Enhancement Ideas

You can further enhance this feature:

๐Ÿ‘‰ Add infinite scrolling (auto-load on scroll)

๐Ÿ‘‰ Combine with search filters

๐Ÿ‘‰ Add loading spinner

๐Ÿ‘‰ Highlight newly loaded rows


๐Ÿ Conclusion

Using a simple JavaScript configuration, you can transform your Interactive Grid into a modern, user-friendly component with a โ€œShow Moreโ€ button.

This small enhancement:

โœ” Improves usability

โœ” Reduces navigation friction

โœ” Makes your app feel more responsive

Love coding? Me too! Letโ€™s keep in touch โ€“ subscribe to my website for regular chats on Oracle APEX, PL/SQL,SQL JavaScript, and CSS.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *