Build beautiful and interactive API documentation for ORDS

Image
In this blog post, I will show you how to quickly build beautiful and interactive API documentation for your Oracle APEX REST data sources using  swagger hub . Using APEX v23.1. I downloaded the  titanic data set  and loaded them into tables in my APEX instance, created some authorized restful services and published them using swagger hub. You can create a free account on swagger hub.   Check out my titanic swagger hub here ; Press Authorize. Username REST, password Glasgow123! I won't go through creating RESTful services and just show you the four I created that sit on top of the titanic data set; The GET is a very simple SQL query;      select * from TITANIC_DATA_SET_NEW A handy tip is to add comments, as there will appear on swagger hub, making your API self documenting; Once you have created your modules, press the Generate Swagger Doc button; This will generate an open API for you.  Copy the API and paste it into swagger hub This will generate the documentation; As mentioned b

Oracle APEX Focus on detail interactive grid from master interactive grid on click

When you have two interactive grids using master-detail you can focus the page on the detail interactive grid when the user clicks on a cell in the master interactive grid.  

This is useful when your master interactive grid has lots of rows that takes up most of the screen, when the user clicks on a row on the master IG the page will focus the page on the detail interactive grid.

I am using APEX Version 19.2.

My master IG has a details column which when the user clicks on it scrolls the page to the details IG.


I give this column a CSS class name of linkToApplicantDetails.

I added an Execute JavaScript code Dynamic Action which uses the class name linkToApplicantDetails as the JQuery Selector for a click;


(Ensure your IQuery Selector has a dot (.) in front of it, i.e. .linkToApplicationDetails)

Because my detail IG is the last table on the page my JavaScript scrolls to the bottom of the page when the user clicks on the column;

    $("html, body").animate({ scrollTop: $(document).height()-$(window).height()});

You could use apex.region namespace focus function to focus the page on the detail IG;

    apex.region( "<< IG STATIC ID>>" ).focus();

The page will focus on the top of the detail IG so I added another line of JS to scroll the page an extra number of pixels.  Play around with this size (130) for your page;

    window.scrollBy(0, 130);

See. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy.

Now when the user clicks on a row on the master detail IG the page will scroll to the detail IG.






Comments

Popular posts from this blog

Oracle APEX Interactive Grid colour cells based on a condition using JavaScript and CSS

Oracle APEX pretty checkbox item plugin

Build beautiful and interactive API documentation for ORDS