### Open PWA Installation Dialog Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.pwa.html Triggers the PWA installation process. For browsers with automatic installation, it starts the process. For others, it opens a dialog with instructions. Can be invoked programmatically or via specific DOM classes/actions. ```javascript apex.pwa.openInstallDialog(); ``` -------------------------------- ### Example: Fetch All Data and Process Records Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/model.html This example demonstrates fetching all data from the model before iterating over each record using model.forEach. The callback function is invoked after each fetch operation completes. ```javascript model.fetchAll( function( status ) { if ( status.done ) { model.forEach( function( record, index, id ) { // do something with each record } ); } } ); ``` -------------------------------- ### Add multiple actions to a specific context Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/actions.html This example shows how to add an array of actions, including one with `get` and `set` functions for dynamic behavior, to a specific actions context obtained via `apex.actions.createContext`. ```javascript log1.add([{ name: "clear-log", label: "Clear", action: function(event, focusElement) {...} }, { name: "verbose", label: "Verbose", get: function() {...}, set: function(value) {...} }, ... ]); ``` -------------------------------- ### isInstallable() Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.pwa.html Determines if the current session is eligible for PWA installation, checking browser prompts, installation status, PWA mode, and device/browser compatibility. ```APIDOC ## isInstallable() ### Description Determines if the current session is eligible for installation of the PWA. This function will detect: the user's browser install prompt is available, the PWA is already installed on the user's device, the user session is currently in PWA mode, the user is on iOS/iPadOS on Safari. Given the user's current device and browser, this function will determine if installing the PWA is possible. ### Returns A Promise that resolves a boolean, based on installation eligibility. Type Promise ### Example ```javascript const isInstallable = await apex.pwa.isInstallable(); ``` ``` -------------------------------- ### Example Usage of apex.date.add and apex.date.subtract Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.date.html Demonstrates how to use the apex.date.add and apex.date.subtract functions with different time units. These examples show adding days and years, and subtracting minutes and hours. ```javascript apex.date.add( myDate, 2, apex.date.UNIT.DAY ); apex.date.add( myDate, 1, apex.date.UNIT.YEAR ); apex.date.subtract( myDate, 30, apex.date.UNIT.MINUTE ); apex.date.subtract( myDate, 6, apex.date.UNIT.HOUR ); ``` -------------------------------- ### Invoke Interactive Grid Action Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/interactiveGrid.html This example shows how to get the actions context for an Interactive Grid instance and invoke a specific action, such as 'save'. ```javascript apex.region("emp").widget().interactiveGrid("getActions").invoke("save"); ``` -------------------------------- ### Check PWA Installability Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.pwa.html Determines if the current session is eligible for PWA installation. It checks for browser install prompts, existing installations, PWA mode, and specific OS/browser combinations. ```javascript const isInstallable = await apex.pwa.isInstallable(); ``` -------------------------------- ### List All Shortcuts Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/actions.html This example iterates through all defined shortcuts and logs their display representation and associated action label to the console. The pWithMarkup parameter is false by default. ```javascript var i, shortcuts = apex.actions.listShortcuts(); for ( i = 0; i < shortcuts.length; i++ ) { // for each shortcut console.log("Press shortcut " + shortcuts[i].shortcutDisplay + " to " + shortcuts[i].actionLabel ); } ``` -------------------------------- ### openInstallDialog() Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.pwa.html Triggers the PWA installation process for browsers with automatic prompts, or opens an instructional dialog for others. Can be invoked programmatically or via specific DOM classes/actions. ```APIDOC ## openInstallDialog() ### Description For browsers with automatic PWA installation, this function triggers the installation process. For browsers without automatic PWA installation, this function opens a dialog with the instruction text. This function is automatically invoked when clicking on any DOM element with the following class: `.a-pwaInstall`. This function is also invoked on `apex.actions` with action name `a-pwa-install`. For example when creating a new APEX application with PWA enabled, a navigation bar entry is added with the `.a-pwaInstall` class and `href="#action$a-pwa-install"`. Developers can add custom buttons to their application and use the `.a-pwaInstall` class or `href="#action$a-pwa-install"` to trigger the PWA installation process. Alternatively, developers can run this function to trigger the PWA installation process programatically for a custom experience. ### Example ```javascript apex.pwa.openInstallDialog(); ``` ``` -------------------------------- ### Get Start of Day Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.date.html Returns a new date object representing the start of the day (midnight) for a given date. Defaults to the current date and time if no date is provided. ```javascript var dayStartDate = apex.date.startOfDay( myDate ); // output: "2021-JUN-29 24:00:00" (as date object) ``` -------------------------------- ### Initialize Grid with Column Options Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Configure grid columns during initialization. This example shows how to set properties like heading, label, alignment, sorting, and width for a 'Name' column. ```javascript $( ".selector" ).grid( { columns: [ { NAME: { heading: "Name", label: "Name", alignment: "start", headingAlignment: "center", seq: 1, canHide: true, canSort: true, hidden: false, isRequired: true, escape: true, frozen: false, noStretch: false, noCopy: false, readonly: false, sortDirection: "asc", sortIndex: 1, width: 98 }, .... } ] } ); ``` -------------------------------- ### Get Expanded Node IDs Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Retrieves the IDs of all currently expanded nodes in the tree. This is useful for saving the expansion state, for example, before a page submission or when the state changes. ```javascript var expandedIds = apex.region( "myTree" ).call( "getExpandedNodeIds" ); $s( "P1_EXPANDED_IDS", expandedIds.join( ":" ) ); ``` -------------------------------- ### Loop Through Tree Model Children Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/model.html This example demonstrates how to iterate over the children of a parent node in a tree-shaped model. It uses `childCount` to get the number of children and `child` to access each child node. ```javascript var i, node; for ( i = 0; i < model.childCount( parentNode ); i++ ) { node = model.child( parentNode, i ); // do something with node } ``` -------------------------------- ### Create and Manage APEX Models Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/model.html Demonstrates how to initialize a model, subscribe to its notifications, render data, clear changes, and release the model when a widget is destroyed. Ensure to unsubscribe before releasing. ```javascript this.model = apex.model.create( modelName, options, initialData, ... ); this.model = apex.model.get( modelName ); this.modelViewId = this.model.subscribe( { onChange: modelNotificationFunction, } ); var count = 0; this.model.forEachInPage( this.pageOffset, pageSize, function( record, index, id ) { if ( record ) { // render the row record count += 1; } if ( count === pageSize || !record ) { // done rendering this page of records } } ); this.model.clearData(); this.pageOffset = 0; this.model.unSubscribe( this.modelViewId ); this.model.release( modelName ); ``` -------------------------------- ### Initialize Grid with Tooltip Configuration Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Configure tooltips for the grid to display custom content. The content function receives additional arguments for context. Tooltips are used for errors and warnings. ```javascript $( ".selector" ).grid( { tooltip: { content: function( callback, model, recordMeta, colMeta, columnDef ) { var text; // calculate the tooltip text return text; } } } ); ``` ```javascript function( options ) { options.defaultGridViewOptions = { tooltip: { content: function( callback, model, recordMeta, colMeta, columnDef ) { var text; // calculate the tooltip text return text; } } }; return options; } ``` -------------------------------- ### Get or set navigation option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Get or set the `navigation` option after the treeView has been initialized. ```javascript // get let value = $( ".selector" ).treeView( "option", "navigation" ); // set $( ".selector" ).treeView( "option", "navigation", true ); ``` -------------------------------- ### Initialize Grid with selectionChange Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this to initialize the grid and specify a callback function for when the selection state changes. No additional data is provided. ```javascript $( ".selector" ).grid({ selectionChange: function( event ) {} }); ``` -------------------------------- ### Initialize with features option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/interactiveGrid.html Controls general features like filtering and flashback. Defaults to both enabled. ```javascript function( options ) { var features = apex.util.getNestedObject( options, "features" ); features.filter = false; features.flashback = false; return options; } ``` -------------------------------- ### Get or set keyboardRename option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Get or set the `keyboardRename` option after the treeView has been initialized. ```javascript // get let value = $( ".selector" ).treeView( "option", "keyboardRename" ); // set $( ".selector" ).treeView( "option", "keyboardRename", true ); ``` -------------------------------- ### Get or Set rowHeaderLabelColumn Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Enables getting or setting the `rowHeaderLabelColumn` property after the grid has been initialized. ```javascript // get let value = $( ".selector" ).grid( "option", "rowHeaderLabelColumn" ); // set $( ".selector" ).grid( "option", "rowHeaderLabelColumn", "PART_NAME" ); ``` -------------------------------- ### Initialize Grid with Custom Context Menu Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Configure a custom context menu for the grid by providing an options object to the `contextMenu` property during initialization. This example defines two actions for the menu. ```javascript $( ".selector" ).grid( { contextMenu: { items:[ { type:"action", label: "Action 1", action: function() { alert("Action 1"); } }, { type:"action", label: "Action 2", action: function() { alert("Action 2"); } } ] } } ); ``` -------------------------------- ### Get or Set noDataMessage Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Provides functionality to get or set the noDataMessage option for an initialized derived-view component. ```javascript // get let value = $( ".selector" ).derived-view( "option", "noDataMessage" ); // set $( ".selector" ).derived-view( "option", "noDataMessage", "No records found." ); ``` -------------------------------- ### Initialize Menu with create Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html Provide a callback function that executes when the menu widget is first created. The ui object is currently empty for this event. ```javascript $( ".selector" ).menu({ create: function( event, ui ) {} }); ``` -------------------------------- ### Get or set selectAllId option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Enables getting the current ID for the select all checkbox or setting a new ID after initialization. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "selectAllId" ); // set $( ".selector" ).tableModelView( "option", "selectAllId", "extSelAll" ); ``` -------------------------------- ### Get or set selectionStatusMessageKey option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Allows for getting the current message key used for selection counts or setting a new one. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "selectionStatusMessageKey" ); // set $( ".selector" ).tableModelView( "option", "selectionStatusMessageKey", "MY_SELECTION_MESSAGE" ); ``` -------------------------------- ### Initializing the tableModelView Widget Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Demonstrates how to create a tableModelView widget with custom templates and data. ```APIDOC ## Initializer #### $(".selector").tableModelView(options) Creates a tableModelView widget. ##### Parameters: Name | Type | Description ---|---|--- `options` | Object | A map of option-value pairs to set on the widget. Since: * 5.1 ##### Example Create a tableModelView for name value pairs displayed in a simple table. ```javascript var fields = { PARTNO: { index: 0 }, PART_DESC: { index: 1 } }, data = [ ["B-10091", "Spark plug"], ["A-12872", "Radiator hose"], ... ]; apex.model.create("parts", { shape: "table", recordIsArray: true, fields: fields, paginationType: "progressive" }, data, data.length ); $("#partsView").tableModelView( { modelName: "parts", beforeTemplate: "", afterTemplate: "
Part NoDescription
", recordTemplate: "&PARTNO.&PART_DESC.", pagination: { scroll: true } } ); ``` ``` -------------------------------- ### Get or Set showNullAs Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Get or set the showNullAs option after initialization. This controls the text displayed for null or empty string values. ```javascript // get let value = $( ".selector" ).recordView( "option", "showNullAs" ); // set $( ".selector" ).recordView( "option", "showNullAs", "- unknown -" ); ``` -------------------------------- ### Initialize Grid with applyTemplateOptions Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Pass options to apex.util.applyTemplate for processing templates. This example shows how to enable the #TODAY# placeholder. ```javascript $( ".selector" ).grid( { applyTemplateOptions: { // This example would enable you to use the placeholder #TODAY# in any templates. placeholders: { TODAY: (new Date()).toISOString() } } } ); ``` -------------------------------- ### Initialize Grid with Pagination Settings Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Configure pagination behavior, including the display of page ranges, links, and buttons. Ensure the model provides total row count for options like showPageLinks and firstAndLastButtons. ```javascript $( ".selector" ).grid( { pagination: { showRange: true, showPageLinks: true, maxLinks: 6, firstAndLastButtons: true } } ); ``` -------------------------------- ### Get or Set entityTitlePlural Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Get or set the plural entity title used in messages. This allows dynamic changes to the display names for entities. ```javascript // get let value = $( ".selector" ).derived-view( "option", "entityTitlePlural" ); // set $( ".selector" ).derived-view( "option", "entityTitlePlural", "Employees" ); ``` -------------------------------- ### Get or Set showExcludeHiddenFields Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Dynamically get or set the showExcludeHiddenFields option. This controls whether users can choose to exclude hidden fields from view. ```javascript // get let value = $( ".selector" ).recordView( "option", "showExcludeHiddenFields" ); // set $( ".selector" ).recordView( "option", "showExcludeHiddenFields", false ); ``` -------------------------------- ### Create Default Node Adapter (With Identity) Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html This example shows how to create a default node adapter for nodes that possess an 'id' property. This is useful for trees where nodes need unique identification. ```javascript var treeData = { id: "0001", label: "Root", children: [ { id: "0009", label: "Child 1", children: [ ... ] }, ... ] }; var adapter = $.apex.treeView.makeDefaultNodeAdapter( treeData ); // the following has the same effect // var adapter = $.apex.treeView.makeDefaultNodeAdapter( treeData, null, true ); ``` -------------------------------- ### Get or Set menubarShowSubMenuIcon Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html This snippet demonstrates how to get the current value or set a new value for the 'menubarShowSubMenuIcon' option after menu initialization. ```javascript // get let value = $( ".selector" ).menu( "option", "menubarShowSubMenuIcon" ); // set $( ".selector" ).menu( "option", "menubarShowSubMenuIcon", true ); ``` -------------------------------- ### Initialize iconList with contextMenu Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/iconList.html Initializes the iconList widget with a custom context menu configuration. This example defines menu items with associated actions. ```javascript $( ".selector" ).iconList( { contextMenu: { items:[ { type:"action", label: "Action 1", action: function() { alert("Action 1"); } }, { type:"action", label: "Action 2", action: function() { alert("Action 2"); } } ] } } ); ``` -------------------------------- ### Get or Set iconList allowCopy Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/iconList.html Shows how to get the current value of the `allowCopy` option or update it after the iconList widget is initialized. This controls clipboard copy functionality. ```javascript // get let value = $( ".selector" ).iconList( "option", "allowCopy" ); // set $( ".selector" ).iconList( "option", "allowCopy", false ); ``` -------------------------------- ### Initialize recordView with fieldGroups Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html This example demonstrates how to initialize a recordView with fields grouped under a specific heading. The `groupName` property on fields links them to the `fieldGroups` definition. ```javascript $( ".selector" ).recordView( { fields:{ FIRST_NAME: { heading: "First", groupName: "NAME", ... }, LAST_NAME: { heading: "Last", groupName: "NAME", .... }, ... }, fieldGroups: { NAME: { label: "Name" }, ... } } ); ``` -------------------------------- ### Create APEX Item with Callbacks Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.item.html Illustrates the syntax for creating an APEX item with most available callbacks and properties. This is useful for plug-in developers defining custom item behavior. ```javascript apex.item.create( "P100_COMPANY_NAME", { item_type: "FANCY_ITEM", displayValueFor: function( pValue ) { var lDisplayValue; // code to determine the display value for pValue return lDisplayValue; }, getPopupSelector: function() { return ""; }, getValidity: function() { var lValidity = { valid: true }; if ( ) { lValidity.valid = false; } return lValidity; }, getValidationMessage: function() { // return validation message if invalid or empty string otherwise }, getValue: function() { var lValue; // code to determine lValue based on the item type. return lValue; }, setValue: function( pValue, pDisplayValue ) { // code that sets pValue and pDisplayValue (if required), for the item type }, reinit: function( pValue, pDisplayValue ) { // set the value possibly using code like // this.setValue( pValue, null, true ); return function() { // make an ajax call that gets new option values for the item } }, disable: function() { // code that disables the item type }, enable: function() { // code that enables the item type }, isDisabled: function() { // return true if item is disabled and false otherwise }, show: function() { // code that shows the item type }, hide: function() { // code that hides the item type }, isChanged: function() { var lChanged; // code to determine if the value has changed return lChanged; }, addValue: function( pValue ) { // code that adds pValue to the values already in the item type }, nullValue: "", setFocusTo: $( "" ), setStyleTo: $( "" ), loadingIndicator: function( pLoadingIndicator$ ){ // code to add the loading indicator in the best place for the item return pLoadingIndicator$; }, storageType: "separated", separator:":" }); ``` -------------------------------- ### Get Selected Tree View Elements Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Retrieves the DOM elements of the currently selected tree view nodes as a jQuery object. Use this to get the visual representation of the selection. ```javascript var selection$ = $( ".selector" ).treeView( "getSelection" ); ``` -------------------------------- ### Initialize Record View with Fields Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Demonstrates how to initialize a recordView widget with a 'fields' option, specifying properties for individual fields like 'NAME'. ```javascript $( ".selector" ).recordView( { fields: [ { NAME: { label: "Name", seq: 1, hidden: false, isRequired: true, escape: true }, .... } ] } ); ``` -------------------------------- ### Initialize Grid with columnReorder Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this to initialize the grid and specify a callback function for when columns have been reordered. ```javascript $( ".selector" ).grid({ columnReorder: function( event, data ) {} }); ``` -------------------------------- ### Get Node Adapter Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Retrieves the tree node adapter instance. Use this to access methods for interacting with the tree's data model, such as getting child counts or node labels. ```javascript var i, count, selectedNode = $( ".selector" ).treeView( "getSelectedNodes" )[0], adapter = $( ".selector" ).treeView( "getNodeAdapter" ); if ( selectedNode ) { count = adapter.childCount( selectedNode ); for ( i = 0; i < count; i++ ) { console.log( "Label: " + adapter.child( selectedNode, i ).label ); } } ``` -------------------------------- ### Initialize Menu with asyncFetchMenu Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html Configure asynchronous fetching of menu items when the menu opens. The callback must be invoked after menu items are populated. ```javascript $( ".selector" ).menu( { asyncFetchMenu: function( menu, callback ) { var promise = apex.server.process( "MY_GET_MENU_ITEMS", ... ); promise.done( function( data ) { // use data to populate menu.items menu.items = ... callback(); } } } ); ``` -------------------------------- ### Get and Set customStyles Property - JavaScript Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/mapRegion.html Demonstrates how to get the current customStyles and how to set new custom styles for point markers. Custom styles define SVG shapes for point markers. ```javascript // get var value = apex.region( "myRegionId" ).customStyles; // set apex.region( "myRegionId" ).customStyles = [ { "name": "MyCamera", "width": 20, "height": 20, "paint-order": "stroke", "viewBox": "0 0 20 20", "elements": [ { "type": "path", "d": "M15 4h-1.2l-.9-1.2c-.4-.5-1-.8-1.6-.8H8.8c-.7 0-1.3.3-1.6.8L6.2 4H5c-1.1 0-2 .9-2 2v5c0 1.1.9 2 2 2h2.2l2.4 4.7c.1.2.4.3.7.2.1 0 .2-.1.2-.2l2.4-4.7H15c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 7c-1.4 0-2.5-1.1-2.5-2.5S8.6 6 10 6s2.5 1.1 2.5 2.5S11.4 11 10 11z" } ] } ]; ``` -------------------------------- ### Initialize treeView with activateNode callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Configure the activateNode callback to execute when nodes are activated via keyboard or double-click. ```javascript $( ".selector" ).treeView({ activateNode: function( event, ui ) {} }); ``` -------------------------------- ### Initialize Grid with selectAll Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this snippet to initialize the grid component with the `selectAll` option set to false. This controls keyboard and checkbox selection behavior. ```javascript $( ".selector" ).grid( { selectAll: false } ); ``` -------------------------------- ### Generate URL for GET Request with Parameters Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/apex.server.html This function generates a URL for a GET request to a specified page or the current page. It allows setting session state for page items and passing scalar values. ```javascript apex.server.url( { p_request: "DELETE", x01: "test", pageItems: "#P1_DEPTNO,#P1_EMPNO" } ); ``` -------------------------------- ### Get Action Value - apex.actions.get Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/actions.html Retrieves the current value of a radio group or toggle action. This is useful for determining the selected option in a radio group or the state of a toggle. An optional `pArgs` object can be passed to the action's get function for more specific retrieval. ```javascript apex.region( "emp" ).call( "getActions" ).get( "change-view" ); ``` -------------------------------- ### type Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/mapRegion.html Gets the type of the map region, which is always 'SpatialMap'. ```APIDOC ## type ### Description Gets the type of the map region. This property is overridden from the base region type and is always "SpatialMap". ### Type string ### Overrides region#type ``` -------------------------------- ### Initialize recordView with modeChange callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Use this to initialize the recordView component and specify a callback function to be executed when the edit mode changes. ```javascript $( ".selector" ).recordView({ modeChange: function( event, data ) {} }); ``` -------------------------------- ### Get and Set Number Field Item Value Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/numberFieldItem.html Provides a shorthand for getting and setting the value of a Number Field item. Note that this property does not support passing additional parameters like display value or suppressing change events, unlike the `getValue` and `setValue` methods. ```javascript var empno = apex.item( "P1_EMPNO" ).getValue(); // is equivalent to: var empno = apex.item( "P1_EMPNO" ).value; // is equivalent to: var empno = apex.items.P1_EMPNO.value; ``` ```javascript apex.item( "P1_EMPNO" ).setValue( "100" ); // is equivalent to: apex.item( "P1_EMPNO" ).value = "100"; // is equivalent to: apex.items.P1_EMPNO.value = "100"; ``` -------------------------------- ### Initialize Menu with useLinks Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html Configure whether menu items with href are rendered as links during initialization. The default is true. ```javascript $( ".selector" ).menu( { useLinks: false } ); ``` -------------------------------- ### Get or Set progressOptions Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Retrieve or update the progressOptions for an initialized tableModelView instance. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "progressOptions" ); // set $( ".selector" ).tableModelView( "option", "progressOptions", null ); ``` -------------------------------- ### Initialize Grid with modeChange Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this to initialize the grid and specify a callback function for when the edit mode changes. The new edit mode is provided in the data. ```javascript $( ".selector" ).grid({ modeChange: function( event, data ) {} }); ``` -------------------------------- ### Get or set keyboardDelete option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Retrieve or update the `keyboardDelete` option after the treeView has been initialized. ```javascript // get let value = $( ".selector" ).treeView( "option", "keyboardDelete" ); // set $( ".selector" ).treeView( "option", "keyboardDelete", true ); ``` -------------------------------- ### Initialize with applyTemplateOptions Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Use this to initialize the derived-view with custom options for apex.util.applyTemplate, such as defining custom placeholders. ```javascript $( ".selector" ).derived-view( { applyTemplateOptions: { // This example would enable you to use the placeholder #TODAY# in any templates. placeholders: { TODAY: (new Date()).toISOString() } } } ); ``` -------------------------------- ### Get or set keyboardAdd option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Access or change the `keyboardAdd` option after the treeView has been initialized. ```javascript // get let value = $( ".selector" ).treeView( "option", "keyboardAdd" ); // set $( ".selector" ).treeView( "option", "keyboardAdd", true ); ``` -------------------------------- ### Initialize derived-view with stickyTop Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Configure the header to stick to the top of the page as it scrolls. This option is only effective if `hasSize` is false. ```javascript $( ".selector" ).derived-view( { stickyTop: true } ); ``` -------------------------------- ### Get or set iconType option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/treeView.html Retrieve or modify the `iconType` option after the treeView has been initialized. ```javascript // get let value = $( ".selector" ).treeView( "option", "iconType" ); // set $( ".selector" ).treeView( "option", "iconType", "fa" ); ``` -------------------------------- ### Basic Shortcut Key Combinations Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/actions.html Examples of common key combinations using modifier keys like Ctrl, Shift, and Alt. These are standard definitions for invoking actions. ```text Ctrl+W ``` ```text Ctrl+Shift+F7 ``` ```text Alt+Page Down ``` -------------------------------- ### Initialize Grid with columnResize Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this to initialize the grid and specify a callback function for when a column's width has been changed. ```javascript $( ".selector" ).grid({ columnResize: function( event, data ) {} }); ``` -------------------------------- ### Get or Set persistSelection Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Retrieve or modify the persistSelection option after the view has been initialized. ```javascript // get let value = $( ".selector" ).derived-view( "option", "persistSelection" ); // set $( ".selector" ).derived-view( "option", "persistSelection", true ); ``` -------------------------------- ### Get or Set Highlights Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelViewBase.html Retrieve or update the highlights configuration after the derived-view has been initialized. ```javascript // get let value = $( ".selector" ).derived-view( "option", "highlights" ); // set $( ".selector" ).derived-view( "option", "highlights", {...} ); ``` -------------------------------- ### isReady() Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/item.html Checks if an item is fully ready to use. This is applicable to items that load asynchronously, such as those implemented with JET or RequireJS. For most items, this will always return true. It's primarily useful for code that runs as the page loads. ```APIDOC ## isReady() ### Description Returns true if the item is fully ready to use and false otherwise. This function is only applicable to items that take extra time to load. For example items that are implemented by libraries that load asynchronously including JET or other libraries that use RequireJS. For most items this will always return true. In addition, it is only useful for code that runs as, or soon after, the page loads. It is not needed in code called from dynamic actions because all dynamic action page load processing waits until after all items are loaded. ### Returns - **boolean**: True if the item is ready, false otherwise. ### Example ```javascript var value = "waiting..."; var theItem = apex.item( "P1_DATE1" ); if ( theItem.isReady() ) { value = theItem.getValue(); } ``` ``` -------------------------------- ### Get or Set noDataMessage option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Retrieves or updates the noDataMessage option after the recordView has been initialized. ```javascript // get let value = $( ".selector" ).recordView( "option", "noDataMessage" ); // set $( ".selector" ).recordView( "option", "noDataMessage", "No records found." ); ``` -------------------------------- ### Initialize Grid with contextMenuAction Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this option to provide a callback function that is executed when the context menu is to be displayed. The function receives the triggering event and is responsible for showing the context menu. ```javascript $( ".selector" ).grid( { contextMenuAction: function( event ) { // do something to display a context menu } } ); ``` -------------------------------- ### Get or Set noDataIcon option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Retrieves or updates the noDataIcon option after the recordView has been initialized. ```javascript // get let value = $( ".selector" ).recordView( "option", "noDataIcon" ); // set $( ".selector" ).recordView( "option", "noDataIcon", "fa fa-warning" ); ``` -------------------------------- ### Create Navigation Menu from Markup Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html Initialize a menu widget from existing unordered list markup. Replace placeholder href values with actual URLs. ```html ``` ```javascript $( "#myMenu" ).menu( {} ); ``` -------------------------------- ### Get or Set labelAlignment option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Retrieves or updates the labelAlignment option after the recordView has been initialized. ```javascript // get let value = $( ".selector" ).recordView( "option", "labelAlignment" ); // set $( ".selector" ).recordView( "option", "labelAlignment", "start" ); ``` -------------------------------- ### Initialize with applyTemplateOptions Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Passes options to apex.util.applyTemplate for processing templates. This allows customization of template placeholders. ```javascript $( ".selector" ).tableModelView( { applyTemplateOptions: { // This example would enable you to use the placeholder #TODAY# in any templates. placeholders: { TODAY: (new Date()).toISOString() } } } ); ``` -------------------------------- ### Get or Set idPrefix option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Retrieves or updates the idPrefix option after the recordView has been initialized. ```javascript // get let value = $( ".selector" ).recordView( "option", "idPrefix" ); // set $( ".selector" ).recordView( "option", "idPrefix", "r1" ); ``` -------------------------------- ### grid() initializer Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Creates a grid widget on a selected element. It accepts an options object to configure the grid's behavior and appearance. ```APIDOC ## $".selector".grid(options) ### Description Creates a grid widget. ### Method JavaScript ### Parameters #### Options - **options** (Object) - A map of option-value pairs to set on the widget. ### Request Example ```javascript const fieldDefinitions = { id: { index: 0, heading: "Id", seq: "1" }, name: { index: 1, heading: "Name", seq: "2" } }; const data = [ ["1022", "Betty"], ["1023", "James"], ... ]; apex.model.create( "myModel", { recordIsArray: true, fields: fieldDefinitions }, data ); $( "#myGrid" ).grid( { modelName: "myModel", columns: [ fieldDefinitions ] } ); ``` ``` -------------------------------- ### Initialize Icon List with multiple Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/iconList.html Set the multiple option to true to allow multiple item selection. If false, only one item can be selected. This option must be false if navigation is true. ```javascript $( ".selector" ).iconList( { multiple: true } ); ``` -------------------------------- ### Get or Set formCssClasses option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Retrieves or updates the formCssClasses option after the recordView has been initialized. ```javascript // get let value = $( ".selector" ).recordView( "option", "formCssClasses" ); // set $( ".selector" ).recordView( "option", "formCssClasses", "u-Form--labelsAbove u-Form--stretchInputs" ); ``` -------------------------------- ### Get searchItem Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/facetsRegion.html Retrieve the name of the search item. This is required when the searchField is not disabled. ```javascript var value = apex.region( "myRegionId" ).searchItem; ``` -------------------------------- ### Initialize Grid with pageChange Callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Use this to initialize the grid and specify a callback function for when the grid's pagination results in new records being displayed. Offset and count are provided. ```javascript $( ".selector" ).grid({ pageChange: function( event, data ) {} }); ``` -------------------------------- ### Get or Set rowsPerPage Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Retrieve or update the rowsPerPage option for an initialized tableModelView instance. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "rowsPerPage" ); // set $( ".selector" ).tableModelView( "option", "rowsPerPage", 50 ); ``` -------------------------------- ### Initialize Grid Widget Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/grid.html Creates a simple non-editable grid with specified columns. Requires a model to be created beforehand. The element with id 'myGrid' should be an empty div. ```javascript const fieldDefinitions = { id: { index: 0, heading: "Id", seq: "1" }, name: { index: 1, heading: "Name", seq: "2" } }; const data = [ ["1022", "Betty"], ["1023", "James"], ... ]; apex.model.create( "myModel", { recordIsArray: true, fields: fieldDefinitions }, data ); $( "#myGrid" ).grid( { modelName: "myModel", columns: [ fieldDefinitions ] } ); ``` -------------------------------- ### Get or Set recordTemplate Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Retrieve or update the recordTemplate option for an initialized tableModelView instance. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "recordTemplate" ); // set $( ".selector" ).tableModelView( "option", "recordTemplate", "
  • &NAME. - &SALARY.
  • " ); ``` -------------------------------- ### listShortcuts(pWithMarkup) Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/actions.html Returns a list of all defined shortcuts within the current context. Optionally, the display name of each shortcut can be returned with HTML markup. ```APIDOC ## listShortcuts(pWithMarkup) ### Description Return a list of all shortcuts in the context. ### Parameters #### Path Parameters * **pWithMarkup** (boolean) - Optional - Default is false. If true wrap the display name in HTML markup. ### Returns An array of objects with information about the shortcut. ### Example This example writes to the console all the shortcuts in the global context. ```javascript var i, shortcuts = apex.actions.listShortcuts(); for ( i = 0; i < shortcuts.length; i++ ) { // for each shortcut console.log("Press shortcut " + shortcuts[i].shortcutDisplay + " to " + shortcuts[i].actionLabel ); } ``` ``` -------------------------------- ### Initialize Menu with Items Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/menu.html Initialize a menu with an array of menu item objects. This is required for menu bars and recommended for popup menus if items are known at initialization. ```javascript $( ".selector" ).menu( { items: [ { type: "action", id: "MyAction1", label: "Action 1", action: function( options, element ) { ... } }, { type: "separator" }, { type: "action", label: "Action 2", action: function( options, element ) { ... } } ] } ); ``` -------------------------------- ### Get or Set persistSelection Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Retrieve or update the persistSelection option for an initialized tableModelView instance. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "persistSelection" ); // set $( ".selector" ).tableModelView( "option", "persistSelection", true ); ``` -------------------------------- ### entityTitlePlural Option Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/tableModelView.html Sets or gets the plural name of the entity. This text is used in count messages. ```APIDOC ## entityTitlePlural Option ### Description This is the name of the plural form of the entity that is the subject of the report. This text is displayed in the total count message and in the selection count message. ### Type * string ### Default Value * null ### Examples Initialize the tableModelView with the entityTitlePlural option specified. ```javascript $( ".selector" ).tableModelView( { entityTitlePlural: "Customers" } ); ``` Get or set option entityTitlePlural after initialization. ```javascript // get let value = $( ".selector" ).tableModelView( "option", "entityTitlePlural" ); // set $( ".selector" ).tableModelView( "option", "entityTitlePlural", "Employees" ); ``` ``` -------------------------------- ### Initialize recordView with recordChange callback Source: https://docs.oracle.com/en/database/oracle/apex/26.1/aexjs/recordView.html Initialize the recordView and define a callback function that will be triggered whenever the current record changes. ```javascript $( ".selector" ).recordView({ recordChange: function( event, data ) {} }); ```