### Manage Menu Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Provides examples for initializing, getting, and setting various menu configuration options like actionsContext, behaveLikeTabs, customContent, and firstItemIsDefault. ```javascript // Initialization $( ".selector" ).menu( { actionsContext: myContext } ); // Get option var value = $( ".selector" ).menu( "option", "actionsContext" ); // Set option $( ".selector" ).menu( "option", "actionsContext", myContext ); ``` -------------------------------- ### Manage treeView Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Provides examples for initializing, getting, and setting various treeView configuration options such as actionsContext, autoCollapse, and clickToRename. ```javascript // Initialize with options $( ".selector" ).treeView( { actionsContext: myContext, autoCollapse: true, clickToRename: true } ); // Get option var value = $( ".selector" ).treeView( "option", "autoCollapse" ); // Set option $( ".selector" ).treeView( "option", "autoCollapse", true ); ``` -------------------------------- ### apex.item.create() - Full Example Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.item.html Demonstrates the creation of an APEX item with various callbacks and properties. ```APIDOC ## apex.item.create() ### Description Creates a new APEX item with specified properties and callbacks. ### Method `apex.item.create( pNd, pItemImpl )` ### Parameters - **pNd** (string) - Required - The static ID of the item. - **pItemImpl** (object | function) - Required - An object containing item properties and callbacks, or a function that defines them. ### Request Example ```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: ":" }); ``` ``` -------------------------------- ### Managing mapRegion Properties Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/mapRegion.html Examples of getting and setting properties like copyrightNotice, customStyles, and layerMessages. ```APIDOC ## GET/SET mapRegion Properties ### Description Accessing or updating configuration properties of the map region after initialization. ### Properties - **copyrightNotice** (string) - HTML expression for copyright. - **customStyles** (Array) - Definitions for custom SVG shapes. - **layerMessages** (Object) - Configuration for data status messages. ### Request Example ```javascript // Get copyright var notice = apex.region("myRegionId").copyrightNotice; // Set layer messages apex.region("myRegionId").layerMessages = { position: "top" }; ``` ``` -------------------------------- ### Get or Set Grid applyTemplateOptions Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Shows how to get the current 'applyTemplateOptions' and how to set new options after grid initialization. This allows for dynamic updates to template processing configurations. ```javascript // get var value = $( ".selector" ).grid( "option", "applyTemplateOptions" ); // set $( ".selector" ).grid( "option", "applyTemplateOptions", { // This example would enable you to use the placeholder #TODAY# in any templates. placeholders: { TODAY: (new Date()).toISOString() } } ); ``` -------------------------------- ### Menu Initialization and Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Demonstrates how to initialize the menu widget with options and how to get or set options after initialization. ```APIDOC ## Initialize Menu with Options ### Description Initializes the menu widget with specified options. The `useLinks` option controls whether menu items act as links. ### Method ```javascript $( ".selector" ).menu( options ); ``` ### Parameters #### Options - **useLinks** (boolean) - Optional - If set to `false`, menu items will not be rendered as links. ### Request Example ```javascript $( ".selector" ).menu( { useLinks: false } ); ``` ## Get or Set Menu Options ### Description Retrieves the current value of an option or sets a new value for an option after the menu has been initialized. ### Method ```javascript $( ".selector" ).menu( "option", optionName [, value ] ); ``` ### Parameters #### Path Parameters - **optionName** (string) - Required - The name of the option to get or set. - **value** (any) - Optional - The new value to set for the option. ### Request Example (Get) ```javascript var value = $( ".selector" ).menu( "option", "useLinks" ); ``` ### Request Example (Set) ```javascript $( ".selector" ).menu( "option", "useLinks", false ); ``` ``` -------------------------------- ### Get or Set selectionStatusMessageKey Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelViewBase.html Provides examples for getting the current selectionStatusMessageKey or setting a new one for the derived-view after initialization. ```javascript // get var value = $( ".selector" ).derived-view( "option", "selectionStatusMessageKey" ); // set $( ".selector" ).derived-view( "option", "selectionStatusMessageKey", "MY_SELECTION_MESSAGE" ); ``` -------------------------------- ### Get Start of Day Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.date.html Returns a new Date object representing the start of the day (midnight) for a given date. If no date object is provided, it defaults to the current date. ```javascript var dayStartDate = apex.date.startOfDay( myDate ); // output: "2021-JUN-29 24:00:00" (as date object) ``` -------------------------------- ### Get or Set resizeColumns Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Provides examples for getting or setting the resizeColumns option of an Interactive Grid after it has been initialized. This enables dynamic adjustment of column resizing behavior. ```javascript // get var value = $( ".selector" ).grid( "option", "resizeColumns" ); // set $( ".selector" ).grid( "option", "resizeColumns", false ); ``` -------------------------------- ### Configure Grid Navigation Constraints Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Examples for initializing the grid with navigation constraints and getting/setting the option after initialization. ```javascript // Initialize with option $( ".selector" ).grid( { constrainNavigation: false } ); // Get option var value = $( ".selector" ).grid( "option", "constrainNavigation" ); // Set option $( ".selector" ).grid( "option", "constrainNavigation", false ); ``` -------------------------------- ### Initialize recordView with Model Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/recordView.html Demonstrates how to define fields, create an APEX model, and initialize a recordView widget bound to that model. ```javascript var fieldDefinitions = { id: { index: 0, heading: "Id", seq: "1" }, name: { index: 1, heading: "Name", seq: "2" } }; var data = [ ["1022", "Betty"], ["1023", "James"] ]; apex.model.create( "myModel", { recordIsArray: true, fields: fieldDefinitions }, data ); $( "#myRecordForm" ).recordView( { modelName: "myModel", fields: [ fieldDefinitions ] } ); ``` -------------------------------- ### Handle Menu create Event Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Shows how to define a create callback during initialization or bind a listener to the menucreate event. ```javascript $( ".selector" ).menu({ create: function( event, ui ) {} }); $( ".selector" ).on( "menucreate", function( event, ui ) {} ); ``` -------------------------------- ### Handle Menu beforeOpen Event Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Shows how to define a beforeOpen callback during initialization or bind a listener to the menubeforeopen event. ```javascript $( ".selector" ).menu({ beforeOpen: function( event, ui ) {} }); $( ".selector" ).on( "menubeforeopen", function( event, ui ) {} ); ``` -------------------------------- ### Get or Set Grid's ShowNullAs Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Provides examples for retrieving or updating the 'showNullAs' option of the grid. This allows for dynamic control over how null values are presented. ```javascript // get var value = $( ".selector" ).grid( "option", "showNullAs" ); // set $( ".selector" ).grid( "option", "showNullAs", "- null -" ); ``` -------------------------------- ### Initialize Grid with Pagination Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Illustrates initializing the grid with various pagination settings. This includes options for controlling the display of page links, maximum number of links, and first/last buttons. ```javascript $( ".selector" ).grid( { pagination: { showRange: true, showPageLinks: true, maxLinks: 6, firstAndLastButtons: true } } ); ``` -------------------------------- ### Configure tableModelView afterTemplate Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Shows how to initialize the tableModelView with a custom afterTemplate, which defines the markup rendered after the report items. It also includes examples for getting and setting the afterTemplate option dynamically. ```javascript $( ".selector" ).tableModelView( { afterTemplate: "" } ); ``` ```javascript // get var value = $( ".selector" ).tableModelView( "option", "afterTemplate" ); // set $( ".selector" ).tableModelView( "option", "afterTemplate", "" ); ``` -------------------------------- ### Get/Set numberFormatOptions in APEX Facets Region Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/facetsRegion.html This example shows how to get or set the 'numberFormatOptions' object. These options are passed to the number formatting functions (apex.locale.formatNumber, apex.locale.formatCompactNumber) and their availability depends on the 'numberFormat' setting. ```javascript var value = apex.region( "myRegionId" ).numberFormatOptions; apex.region( "myRegionId" ).numberFormatOptions = { maximumFractionDigits: 1 }; ``` -------------------------------- ### Retrieve Model Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/model.html Demonstrates how to fetch specific configuration options from the model instance. ```javascript var markForDelete = model.getOption( "onlyMarkForDelete" ); var hasTotalRecords = model.getOption( "hasTotalRecords" ); ``` -------------------------------- ### Configure tableModelView aggregateTemplate Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Illustrates initializing the tableModelView with an aggregateTemplate for rendering aggregate records. This template supports special substitution symbols for aggregates and row identification. Examples for getting and setting the aggregateTemplate are also provided. ```javascript $( ".selector" ).tableModelView( { aggregateTemplate: "
  • {case APEX$AGG/}{"when SUM"}Total: &SALARY.{endcase/}
  • " } ); ``` ```javascript // get var value = $( ".selector" ).tableModelView( "option", "aggregateTemplate" ); // set $( ".selector" ).tableModelView( "option", "aggregateTemplate", "
  • {case APEX$AGG/}{"when SUM"}Total: &SALARY.{endcase/}
  • " ); ``` -------------------------------- ### recordView Initialization and Configuration Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/recordView.html Documentation for initializing the recordView widget and managing its configuration options. ```APIDOC ## recordView Widget ### Description The recordView widget is used to display data from an apex.model. It supports features like field grouping, template application, and editable modes. ### Method jQuery Widget Initialization ### Options - **actionsContext** (actions) - Optional - Actions context to use for the widget. - **alwaysEdit** (boolean) - Optional - If true, the view starts in edit mode and ignores standard toggle keys. - **applyTemplateOptions** (object) - Optional - Configuration for template processing via apex.util.applyTemplate. - **autoAddRecord** (boolean) - Optional - Automatically adds a new record if the model is empty. - **editable** (boolean) - Optional - Determines if the view allows data editing. - **fieldGroups** (Object) - Optional - Defines headings for grouping fields together. ### Usage Example ```javascript // Initialize recordView $( "#myRecordForm" ).recordView( { modelName: "myModel", editable: true, alwaysEdit: false } ); // Get/Set options var isEditable = $( ".selector" ).recordView( "option", "editable" ); $( ".selector" ).recordView( "option", "editable", true ); ``` ``` -------------------------------- ### APEX Tree: Get Selected Nodes (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html This example shows how to retrieve an array of data model nodes that correspond to the currently selected tree view nodes in an APEX Tree region. It uses the `getSelectedNodes` method. ```JavaScript var selectedNodes = $( ".selector" ).treeView( "getSelectedNodes" ); ``` -------------------------------- ### Create APEX Item with Callbacks and Properties (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.item.html Demonstrates the creation of an APEX item using apex.item.create with a comprehensive set of available callbacks and properties. This example illustrates the syntax for defining item behavior, including display value logic, popup selectors, validation, value retrieval and setting, reinitialization, enabling/disabling, visibility, change detection, and styling. ```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: ":" }); ``` -------------------------------- ### Escaping Open Brackets in APEX Templates Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.util.html Explains how to escape a lone open bracket '{' when it might be misinterpreted as the start of a directive. The `{{/}` syntax is used for this purpose. Examples show when escaping is necessary and when it is not, depending on the context and surrounding characters. ```HTML The coordinates {{/}c, d} = {if VAL/}&VAL.{else/}unknown{endif/} ``` ```HTML The coordinates { c, d } = {if VAL/}&VAL.{else/}unknown{endif/} ``` ```HTML The coordinates {c, d} = {if VAL/}&VAL.{else/}unknown{endif/} ``` -------------------------------- ### Initialize Menu with Action Items Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Demonstrates how to create a popup menu by passing an array of action objects to the menu widget constructor. ```javascript $( "#myMenu" ).menu( { items:[ { type:"action", label: "Action 1", action: function() { alert("Action 1"); } }, { type:"action", label: "Action 2", action: function() { alert("Action 2"); } } ] } ); ``` -------------------------------- ### Initialize Interactive Grid View and Model Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/interactiveGrid.html Examples of setting default options for detail, grid, and icon views, as well as model-specific settings during Interactive Grid initialization. ```JavaScript function( options ) { options.defaultDetailViewOptions = { footer: false }; return options; } ``` ```JavaScript function( options ) { options.defaultGridViewOptions = { multiple: true, allowInsert: false }; return options; } ``` ```JavaScript function( options ) { options.defaultIconViewOptions = { footer: false }; return options; } ``` ```JavaScript function( options ) { options.defaultModelOptions = { pageSize: 200 }; return options; } ``` -------------------------------- ### Get/Set persistState Option in APEX Facets Region Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/facetsRegion.html This code example shows how to get or set the 'persistState' boolean option. When true, it persists the collapsed state of facet controls and chart states using browser session storage. ```javascript var value = apex.region( "myRegionId" ).persistState; apex.region( "myRegionId" ).persistState = false; ``` -------------------------------- ### APEX Tree: Log Child Node Labels (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html This example retrieves the first selected node in an APEX Tree region and iterates through its children, logging their labels to the console. It utilizes `getSelectedNodes` to get the selected node and `getNodeAdapter` to access node properties. ```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 ); } } ``` -------------------------------- ### TreeView Initialization and Option Management Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Demonstrates how to initialize the TreeView widget with options and how to get or set options after initialization. ```APIDOC ## TreeView Options This section details the various options available for the TreeView widget. ### dragMultiple #### Description Specifies whether multiple nodes can be dragged simultaneously. #### Type * boolean #### Default Value * false #### Examples ##### Initialize TreeView with dragMultiple ```javascript $( ".selector" ).treeView( { dragMultiple: true } ); ``` ##### Get or Set dragMultiple Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragMultiple" ); // Set $( ".selector" ).treeView( "option", "dragMultiple", true ); ``` ### dragOpacity #### Description Sets the opacity for the helper element while dragging. Refers to jQuery UI draggable `opacity` option. #### Type * false | number #### Default Value * false #### Examples ##### Initialize TreeView with dragOpacity ```javascript $( ".selector" ).treeView( { dragOpacity: 0.4 } ); ``` ##### Get or Set dragOpacity Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragOpacity" ); // Set $( ".selector" ).treeView( "option", "dragOpacity", 0.4 ); ``` ### dragReorder #### Description If true, nodes can be reordered using drag and drop. If false, drag and drop only moves or copies nodes between parent nodes. #### Type * boolean #### Default Value * false #### Examples ##### Initialize TreeView with dragReorder ```javascript $( ".selector" ).treeView( { dragReorder: true } ); ``` ##### Get or Set dragReorder Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragReorder" ); // Set $( ".selector" ).treeView( "option", "dragReorder", true ); ``` ### dragScroll #### Description If set to true, the container auto-scrolls while dragging. Refers to jQuery UI draggable `scroll` option. #### Type * boolean #### Default Value * true #### Examples ##### Initialize TreeView with dragScroll ```javascript $( ".selector" ).treeView( { dragScroll: false } ); ``` ##### Get or Set dragScroll Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragScroll" ); // Set $( ".selector" ).treeView( "option", "dragScroll", false ); ``` ### dragScrollSensitivity #### Description Distance in pixels from the edge of the viewport after which the viewport should scroll. Distance is relative to the pointer, not the draggable. Refers to jQuery UI draggable `scrollSensitivity` option. #### Type * number #### Default Value * 20 #### Examples ##### Initialize TreeView with dragScrollSensitivity ```javascript $( ".selector" ).treeView( { dragScrollSensitivity: 30 } ); ``` ##### Get or Set dragScrollSensitivity Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragScrollSensitivity" ); // Set $( ".selector" ).treeView( "option", "dragScrollSensitivity", 30 ); ``` ### dragScrollSpeed #### Description The speed at which the viewport should scroll. Refers to jQuery UI draggable `scrollSpeed` option. #### Type * number #### Default Value * 10 #### Examples ##### Initialize TreeView with dragScrollSpeed ```javascript $( ".selector" ).treeView( { dragScrollSpeed: 8 } ); ``` ##### Get or Set dragScrollSpeed Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragScrollSpeed" ); // Set $( ".selector" ).treeView( "option", "dragScrollSpeed", 8 ); ``` ### dragZIndex #### Description Z-index for the helper element while being dragged. Refers to jQuery UI draggable `zIndex` option. #### Type * number #### Default Value * 1000 #### Examples ##### Initialize TreeView with dragZIndex ```javascript $( ".selector" ).treeView( { dragZIndex: 1001 } ); ``` ##### Get or Set dragZIndex Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "dragZIndex" ); // Set $( ".selector" ).treeView( "option", "dragZIndex", 1001 ); ``` ### expandRoot #### Description If true, the root node is initially expanded; otherwise, it is collapsed. Option `expandRoot` cannot be false when `treeView#collapsibleRoot` is false. #### Type * boolean #### Default Value * true #### Examples ##### Initialize TreeView with expandRoot ```javascript $( ".selector" ).treeView( { expandRoot: false } ); ``` ##### Get or Set expandRoot Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "expandRoot" ); // Set $( ".selector" ).treeView( "option", "expandRoot", false ); ``` ### getNodeAdapter #### Description A no-argument function that returns an object implementing the `treeNodeAdapter` interface. The node adapter provides access to the data behind the treeView. This option is required unless the tree data is supplied by markup. #### Type * function #### Default Value * null #### Examples ##### Initialize TreeView with getNodeAdapter ```javascript $( ".selector" ).treeView( { getNodeAdapter: function() { return myAdapter; } } ); ``` ### iconType #### Description CSS class name for the icon type. The `iconType` along with the value returned by `treeNodeAdapter#getIcon` determine the classes used for the tree node icon. #### Type * string #### Default Value * "icon" #### Examples ##### Initialize TreeView with iconType ```javascript $( ".selector" ).treeView( { iconType: "my-custom-icon" } ); ``` ##### Get or Set iconType Option ```javascript // Get var value = $( ".selector" ).treeView( "option", "iconType" ); // Set $( ".selector" ).treeView( "option", "iconType", "my-custom-icon" ); ``` ``` -------------------------------- ### Initialize Grid Widget Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Demonstrates how to create a data model and initialize a basic non-editable grid widget. ```APIDOC ## Initialize Grid Widget ### Description Creates a new grid instance linked to a specific data model. ### Method JavaScript Initialization ### Endpoint $(selector).grid(options) ### Request Example var fieldDefinitions = { id: { index: 0, heading: "Id" }, name: { index: 1, heading: "Name" } }; apex.model.create( "myModel", { fields: fieldDefinitions }, data ); $( "#myGrid" ).grid( { modelName: "myModel", columns: [ fieldDefinitions ] } ); ``` -------------------------------- ### Get APEX Model Instance (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.model.html This example shows how to retrieve a specific APEX data model by its identifier. After obtaining the model instance, you can perform operations on it. It's important to release the model using `apex.model.release()` when it's no longer needed to manage resources effectively. ```javascript var myModel = apex.model.get("MyModel"); // ... do something with myModel apex.model.release("MyModel"); // release it when done ``` -------------------------------- ### Get/Set searchField Option in APEX Facets Region Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/facetsRegion.html This example shows how to get or set the 'searchField' option. It controls the presence and type of the search input. It can be a boolean (true to include a search field, false to omit) or a string representing the ID of a page item to use as the search field. In smart filter mode ('S'), it's always forced to true. ```javascript var value = apex.region( "myRegionId" ).searchField; apex.region( "myRegionId" ).searchField = "P1_SEARCH"; ``` -------------------------------- ### Initialize recordView with progressOptions Option (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/recordView.html Shows how to initialize the recordView with specific 'progressOptions'. These options are passed to apex.util.showSpinner to customize the loading indicator. ```javascript $( ".selector" ).recordView( { progressOptions: null } ); ``` -------------------------------- ### Open PWA Install Dialog (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.pwa.html Triggers the PWA installation process. For browsers with automatic installation, it initiates the process directly. For others, it opens a dialog with installation instructions. This can be invoked programmatically or via specific DOM elements/actions. ```javascript apex.pwa.openInstallDialog(); ``` -------------------------------- ### Initialize and Listen to treeView beginEdit Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Demonstrates how to handle the beginEdit event by either passing a callback during initialization or binding a listener to the treeviewbeginedit event. ```javascript $( ".selector" ).treeView({ beginEdit: function( event, ui ) {} }); $( ".selector" ).on( "treeviewbeginedit", function( event, ui ) {} ); ``` -------------------------------- ### Initialize Grid with Column Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Demonstrates how to initialize an APEX grid widget with specific column configurations, including sorting, alignment, and display properties. ```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 } } ] } ); ``` -------------------------------- ### Check PWA Installability (JavaScript) Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.pwa.html Determines if the current session is eligible to install the Progressive Web App. It checks for browser install prompts, existing installations, PWA mode, and device/browser compatibility. Returns a Promise that resolves to a boolean. ```javascript const isInstallable = await apex.pwa.isInstallable(); ``` -------------------------------- ### apex.pwa.openInstallDialog Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.pwa.html Triggers the PWA installation process or opens the installation instruction dialog. ```APIDOC ## apex.pwa.openInstallDialog() ### Description Opens the installation dialog for the PWA. This can be triggered programmatically or via specific CSS classes/actions in the UI. ### Method Static Function ### Example ```javascript apex.pwa.openInstallDialog(); ``` ``` -------------------------------- ### Initialize Grid Widget with Data Model Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Demonstrates how to define field definitions, create a data model using apex.model.create, and initialize a grid widget bound to that model. ```javascript var fieldDefinitions = { id: { index: 0, heading: "Id", seq: "1" }, name: { index: 1, heading: "Name", seq: "2" } }; var data = [ ["1022", "Betty"], ["1023", "James"] ]; apex.model.create( "myModel", { recordIsArray: true, fields: fieldDefinitions }, data ); $( "#myGrid" ).grid( { modelName: "myModel", columns: [ fieldDefinitions ] } ); ``` -------------------------------- ### Creating Actions from HTML Markup Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/actions.html Demonstrates how to define actions using standard HTML list markup and register them into the global context using addFromMarkup. ```html ``` ```javascript apex.actions.addFromMarkup($("#myActionList")); ``` -------------------------------- ### GET apex.server.pluginUrl Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/apex.server.html Generates a URL for a GET request to a plugin-defined Ajax function. ```APIDOC ## GET apex.server.pluginUrl ### Description Returns the URL to issue a GET request to the PL/SQL Ajax function defined for a plug-in. ### Method GET ### Endpoint apex.server.pluginUrl(pAjaxIdentifier, pData) ### Parameters #### Path Parameters - **pAjaxIdentifier** (string) - Required - The identifier returned by apex_plugin.get_ajax_identifier. #### Query Parameters - **pData** (Object) - Optional - Object containing additional values to be included in the URL, such as pageItems or scalar parameters x01-x10. ### Response #### Success Response (200) - **URL** (string) - The generated URL string. ``` -------------------------------- ### Interactive Grid Initialization Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/interactiveGrid.html Configuring the Interactive Grid toolbar and master-detail selection behavior during initialization. ```APIDOC ## Interactive Grid Initialization ### Description Customize the Interactive Grid behavior and UI components using the Initialization JavaScript Function attribute. ### Parameters #### Options - **toolbarData** (Object) - Optional - Configuration object for the toolbar layout. - **trackParentSelection** (boolean) - Optional - Determines if detail grids automatically update based on master region selection. Default: true. ### Request Example ```javascript function( options ) { var $ = apex.jQuery, toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(); options.toolbarData = toolbarData; options.trackParentSelection = false; return options; } ``` ``` -------------------------------- ### Get or Set stickyFooter Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelViewBase.html Shows how to get the current stickyFooter setting or change it for the derived-view after it has been initialized. ```javascript // get var value = $( ".selector" ).derived-view( "option", "stickyFooter" ); // set $( ".selector" ).derived-view( "option", "stickyFooter", true ); ``` -------------------------------- ### Configure Grid Aggregate Tooltips Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Demonstrates setting aggregate tooltips using a map of aggregate names and column names. ```javascript $( ".selector" ).grid( { aggregateTooltips: { "AVG|SALARY": "Average Salary" } } ); // get var value = $( ".selector" ).grid( "option", "aggregateTooltips" ); // set $( ".selector" ).grid( "option", "aggregateTooltips", {...} ); ``` -------------------------------- ### Get or Set progressOptions option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Shows how to get the current value of the progressOptions or set a new value for it after the tableModelView has been initialized. ```javascript // get var value = $( ".selector" ).tableModelView( "option", "progressOptions" ); // set $( ".selector" ).tableModelView( "option", "progressOptions", null ); ``` -------------------------------- ### Get or Set progressOptions Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelViewBase.html Shows how to get the current value of the progressOptions or set a new value for the derived-view after initialization. ```javascript // get var value = $( ".selector" ).derived-view( "option", "progressOptions" ); // set $( ".selector" ).derived-view( "option", "progressOptions", null ); ``` -------------------------------- ### Grid Widget Initialization and Events Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Demonstrates how to initialize the grid widget and handle the `sortChange` event. ```APIDOC ## Grid Widget Initialization and Events ### Description This section covers the initialization of the grid widget and how to respond to sorting changes. ### Initialization Example ```javascript $( ".selector" ).grid({ sortChange: function( event, data ) {} }); ``` ### Event Binding Example ```javascript $( ".selector" ).on( "gridsortchange", function( event, data ) {} ); ``` ``` -------------------------------- ### Get or Set progressOptions Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Shows how to get or set the progressOptions for an Interactive Grid after initialization. This allows for dynamic modification of spinner behavior. ```javascript // get var value = $( ".selector" ).grid( "option", "progressOptions" ); // set $( ".selector" ).grid( "option", "progressOptions", null ); ``` -------------------------------- ### Configure Menu useLinks Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/menu.html Demonstrates how to initialize the menu with the useLinks option or get/set it after initialization. ```javascript $( ".selector" ).menu( { useLinks: false } ); // get var value = $( ".selector" ).menu( "option", "useLinks" ); // set $( ".selector" ).menu( "option", "useLinks", false ); ``` -------------------------------- ### Get or set hideDeletedRows option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Enables getting or setting the hideDeletedRows option after tableModelView initialization. This controls the display behavior of deleted rows dynamically. ```javascript // get var value = $( ".selector" ).tableModelView( "option", "hideDeletedRows" ); // set $( ".selector" ).tableModelView( "option", "hideDeletedRows", true ); ``` -------------------------------- ### Configure treeView Context Menu Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Demonstrates how to initialize the treeView widget with context menu actions or specific menu IDs to handle user interactions. ```javascript $( ".selector" ).treeView( { contextMenuAction: function( event ) { // do something to display a context menu } } ); $( ".selector" ).treeView( { contextMenuId: "myContextMenu" } ); ``` -------------------------------- ### Get or Set tableModelView linkAttributes Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Shows how to get or set the linkAttributes option for the tableModelView widget. These attributes are applied to anchor elements when links are present. ```javascript // get var value = $( ".selector" ).tableModelView( "option", "linkAttributes" ); // set $( ".selector" ).tableModelView( "option", "linkAttributes", "target='_blank'" ); ``` -------------------------------- ### Get or set highlights option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Enables getting or setting the highlights configuration object after tableModelView initialization, allowing for dynamic management of row and cell styling. ```javascript // get var value = $( ".selector" ).tableModelView( "option", "highlights" ); // set $( ".selector" ).tableModelView( "option", "highlights", {...} ); ``` -------------------------------- ### Initialize Grid with applyTemplateOptions Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Initializes the grid with 'applyTemplateOptions', which are passed to apex.util.applyTemplate. This example shows how to define custom placeholders for template processing, such as injecting the current date. ```javascript $( ".selector" ).grid( { applyTemplateOptions: { // This example would enable you to use the placeholder #TODAY# in any templates. placeholders: { TODAY: (new Date()).toISOString() } } } ); ``` -------------------------------- ### Get or Set Row Header Label Column Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Shows how to get the current value of the `rowHeaderLabelColumn` option or set a new value for it after grid initialization. ```javascript // get var value = $( ".selector" ).grid( "option", "rowHeaderLabelColumn" ); // set $( ".selector" ).grid( "option", "rowHeaderLabelColumn", "PART_NAME" ); ``` -------------------------------- ### Initialize recordView with Fields Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/recordView.html Demonstrates how to initialize the recordView widget by defining the fields configuration array, including properties like label, sequence, and validation requirements. ```javascript $( ".selector" ).recordView( { fields: [ { NAME: { label: "Name", seq: 1, hidden: false, isRequired: true, escape: true }, .... } ] } ); ``` -------------------------------- ### Get or Set Grid's SelectionStatusMessageKey Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Shows how to get or set the 'selectionStatusMessageKey' option for the grid after initialization. This allows dynamic changes to the selection count message. ```javascript // get var value = $( ".selector" ).grid( "option", "selectionStatusMessageKey" ); // set $( ".selector" ).grid( "option", "selectionStatusMessageKey", "MY_SELECTION_MESSAGE" ); ``` -------------------------------- ### Configure Grid Context Menu Action Callback Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Initializes the grid with a custom callback function to handle context menu display. ```javascript $( ".selector" ).grid( { contextMenuAction: function( event ) { // do something to display a context menu } } ); ``` -------------------------------- ### Get or Set Grid collapsibleControlBreaks Option Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Shows how to get the current value of 'collapsibleControlBreaks' and how to set it after the grid is initialized. This controls whether control breaks can be collapsed or expanded. ```javascript // get var value = $( ".selector" ).grid( "option", "collapsibleControlBreaks" ); // set $( ".selector" ).grid( "option", "collapsibleControlBreaks", false ); ``` -------------------------------- ### Initialize Derived View with Pagination Options Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelViewBase.html Initializes the derived-view component with specific pagination settings. This example shows how to configure options such as showing page links, the maximum number of links, and enabling first and last page buttons. ```javascript $( ".selector" ).derived-view( { pagination: { showRange: true, showPageLinks: true, maxLinks: 6, firstAndLastButtons: true } } ); ``` -------------------------------- ### Initialize Grid with Column Groups Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/grid.html Initializes the grid with column definitions and column group definitions. This example demonstrates grouping 'First Name' and 'Last Name' columns under a 'Name' heading group, showcasing multi-level column organization. ```javascript $( ".selector" ).grid( { columns:[ { FIRST_NAME: { heading: "First", groupName: "NAME", ... }, LAST_NAME: { heading: "Last", groupName: "NAME", .... }, ... ], columnGroups: { NAME: { heading: "Name", headingAlignment: "start" }, ... } } ); ``` -------------------------------- ### Get or Set dragScroll Option for treeView Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Demonstrates how to get or set the 'dragScroll' option for the treeView widget. This option enables or disables the auto-scrolling of the container when a node is being dragged. ```javascript // get var value = $( ".selector" ).treeView( "option", "dragScroll" ); // set $( ".selector" ).treeView( "option", "dragScroll", false ); ``` -------------------------------- ### Item isReady() Method Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/item.html Returns true if the item is fully ready to use, particularly for items loading asynchronously (e.g., JET, RequireJS). Useful for code running at page load. ```APIDOC ## POST /websites/oracle_en_database_oracle_apex_24_2_aexjs ### Description Returns true if the item is fully ready to use, particularly for items loading asynchronously (e.g., JET, RequireJS). Useful for code running at page load. ### Method JavaScript ### Endpoint N/A (JavaScript API) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript var value = "waiting...", theItem = apex.item( "P1_DATE1" ); if ( theItem.isReady() ) { value = theItem.getValue(); } ``` ### Response #### Success Response (200) - **return value** (boolean) - true if the item is ready, false otherwise. #### Response Example ```json { "returnValue": true } ``` ``` -------------------------------- ### Initialize treeView with Default Node Adapter Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/treeView.html Demonstrates how to create a treeView by defining a data object and using the makeDefaultNodeAdapter method to bind it to a DOM element. ```javascript var treeData = { label: "Root", children: [ { label: "Child 1", children: [ { label: "Grandchild" } ] }, { label: "Child 2", children: [] } ] }; var myAdapter = $.apex.treeView.makeDefaultNodeAdapter( treeData ); $( "#simpleTree" ).treeView( { getNodeAdapter: function() { return myAdapter; }, expandRoot: false } ); ``` -------------------------------- ### Get or Set stickyFooter option in tableModelView Source: https://docs.oracle.com/en/database/oracle/apex/24.2/aexjs/tableModelView.html Shows how to get or set the stickyFooter option for a tableModelView instance. This allows for runtime modification of the footer's fixed positioning behavior. ```javascript // get var value = $( ".selector" ).tableModelView( "option", "stickyFooter" ); // set $( ".selector" ).tableModelView( "option", "stickyFooter", true ); ```