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 generat...
Oracle APEX Remove the aggregate totals column in an Interactive Grid
- Get link
- X
- Other Apps
This post explains how to remove the Overall Average column on an IG when aggregates are added to an IG. I am using APEX version 19.2 but this should work on all versions. I added aggregates to my IG which gives me a row of averages at the bottom of the grid;
It also gives me a total averages column at the start of the grid;
There are 2 reasons I don't want this column. Firstly, in my experience with this column its very buggy, as you can see in the picture below it causes the rows of the grid to get out of sync when sorting.
Secondly I have a lot of columns and I want the grid to appear at 100% zoom on the browser with no scrolling and this column is taking up valuable retail space!
So.....how do we remove it?
In execute when page loads, add this JavaScript where rgBenchmarkingIG is the static ID of your Interactive Grid.
apex.region("rgBenchmarkingIG").widget().interactiveGrid("getCurrentView").view$.grid("option", "rowHeader", "none");
OK, now gone. But how does the user know that the totals at the bottom are averages?
We can use CSS to add the text Avg to the first column. Usually first columns are names, links (like mine) etc, so we can put the text 'Avg' here ({content: 'Avg';}). In Inline CSS add this;
#rgBenchmarkingIG_ig_grid_vc > div.a-GV-bdy > div.a-GV-w-scroll > table > tbody > tr.a-GV-row.is-aggregate.a-GV-aggregate--AVG.is-grandTotal > td:nth-child(1):after {content: 'Avg';}
Note this is for averages (aggregate--AVG), you will need to change the CSS for sum etc.
This now tells the user the totals row is averages and gives us more space for the grid to fit on the page without scrolling;
Popular posts from this blog
Oracle APEX Interactive Grid colour cells based on a condition using JavaScript and CSS
In this post I will describe how to colour an Interactive Grid based on a column condition using CSS and JavaScript. Using APEX Version 19.2. I want to colour every column red in my IG when the value is 'No'. I have several IGs on my page I want to colour, so I set all my IGs that I want to colour with a CSS class of ATTENDEE_SCORE_IG in the Appearance section of the IG; Every column I want to colour in the IG I set the CSS Class to COLOUR_YES_NO (in this example I set this in 5 columns); I then created a Dynamic Action (DA) that contains the JavaScript that has the condition check that will colour the cells. Because I have several IGs that are details of the master/detail relationship and these are refreshed by the user clicking on the master detail IG I have made my DA a Page Change [Interactive Grid]. If you don't need this you can set the DA on page load. The JS which will colour every column is this; ////////////////////////////////////////////////////...
Oracle APEX style an Interactive Grid cell conditionally based on the value of another cell using JavaScript and CSS
This blog post describes how you can style an Interactive Grid cell conditionally based on the value of another cell using JQuery and CSS. Using APEX Version 19.2. The requirement is to highlight the cell that has the highest value in the row; This can be achieved by setting the IG column CSS class and using JQuery to loop round the table rows to conditionally set CSS style based on cell values First give all your columns a CSS Class (note you can give columns multiple classes separated with space) in this case all 4 columns are set with CSS class SCORE_C_1, SCORE_C_2, SCORE_C3 and SCORE_C_4 in the column Appearance; We now add the JavaScript in Execute when page loads (preferably put this is a JS file). We are using the JQuery $.each() method to fetch every table row; $.each($('tbody tr'), function(i, item) {} and the JQuery text() method to get the column value from the row using the column CSS class names; var scoreC1 = $(item).find('.SCOR...
Add a timeline diagram chart to your APEX app - Part 2 of the HighChart Series
How to add a timeline diagram chart to your APEX app using HighCharts and JQuery. This is the second in the series of blog posts showing you how to add HighCharts to your APEX application. Demo I have been using HighCharts in my web apps for a number of years and in my opinion its the best charting JavaScript library out there, its free to use for non-commercial use, robust, well documented, mobile friendly and a great addition to your APEX app. I work for the University of Glasgow and the next project I am starting is an APEX project where staff members apply for academic promotion. There are many stages to the application process, manager approval, board of review, college review, etc. A timeline diagram displaying the process to the users will be ideal. This is how I will do it. As an aside, for American readers this is a fascinating story I have recently learned about the University. James McCune Smith born a slave and the first Afric...
Comments
Post a Comment