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 Interactive Grid rename aggregate row label

This post describes how to rename an Interactive Grid aggregate totals row name.  I am using APEX 19.2.

The default name is "Overall Sum" for the totals row, this was knocking out the other rows slightly so I needed to make it "Total" instead.

The solution was to add the following JavaScript into the function and Global Variable Declaration.

The JS is as follows;

/******************************************************************************************

* The spreadsheet (IG) totals default name is "Overall Sum".  Rename it "Total".
* Param spreadsheetID : The Interactive grid ID
*******************************************************************************************/
function renameOverallSumToTotal(spreadsheetID) 
{      
     var g = apex.region(spreadsheetID).widget().interactiveGrid('getViews', 'grid');          

     var labels = g.view$.grid('option', 'aggregateLabels');      
     labels.SUM.label = 'Subtotal';      
     labels.SUM.overallLabel = 'Total';   
     g.view$.grid('option', 'aggregateLabels', labels);      
  
     g.view$.grid('refresh');
}

// Rename the totals rows on both spreadsheets
$('#pgrCalculation').on('interactivegridviewchange', function(event , ui)
 {    
    renameOverallSumToTotal('pgrCalculation');
});

where pgrCalculation is the static ID of the Interactive Grid


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