Skip to main content

Posts

Showing posts from May, 2020

Oracle JET Custom renderers – JS and HTML template

This blog explains how to define custom renderers in Oracle JET. We have defined the layout as below and will populate those areas with flight information. First column: Departing flights Second column: All flights Third column: Arriving flights   Finally it should look like: We will start with the “second column” – All Flights. To get all Flights info the API we will be using is : /api/getAllFlights For that, we will make use of Oracle JET Collection model. I will first define a Model object which can parse each Flight info from the API. self.AllFlight = oj.Model.extend({     parse: self.parseAllFlights,     idAttribute: 'Flight' }); “parseAllFlights” is a method which will extract the information out of the response and put it in a JSON object. self.parseAllFlights = function (response) {     return {Flight: response['FLIGHT_NUMBER'], Place: response['PLACE'],                         Airline: response['AIRLINES']