- Since:
- 5.1
The jQuery object for the region element.
Type:
- jQuery
Example
var value = apex.region( "myRegionId" ).element;
Identifies the parent (master) region ID, if the region is the detail region of a master detail relationship.
Type:
- string
Example
var value = apex.region( "myRegionId" ).parentRegionId;
Identifies the type of the region. Regions that don't implement a custom region interface have type "generic".
Type:
- string
Example
var value = apex.region( "myRegionId" ).type;
For regions that are implemented with a jQuery UI style widget, this is the name of the widget. For other widget implementations it is null. It is used internally by the region#call, region#on and region#off methods.
Type:
- string
Example
var value = apex.region( "myRegionId" ).widgetName;
Return an alternative loading indicator for the given element. Not all regions have this method so check if it exists before calling. For regions that support column items and when the column items may not be visible on the screen at all times this allows the region to place the loading indicator in an appropriate location. This can return the loading indicator passed in or return a completely new loading indicator.
Parameters:
Name | Type | Description |
---|---|---|
pElement |
Element | DOM element that may represent a column item. |
pLoadingIndicator$ |
jQuery | A loading indicator that can be inserted in to the DOM where desired and returned or ignored. |
Returns:
- Type
- jQuery
Calls a method on the widget associated with the region. This method only applies to regions that are implemented with a jQuery UI style widget.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
pMethod |
string | The string name of the widget method. | |
args |
* |
<repeatable> |
Any number of arguments to be passed to the widget method. |
Returns:
- Type
- *
Example
var records1 = apex.region( "emp" ).call( "getSelectedRecords" );
// same result as above but this is more verbose
var records2 = apex.region( "emp" ).widget().interactiveGrid( "getSelectedRecords" );
Cause the region to take focus. Not all native or plug-in regions support taking focus. It is up to the specific region to determine where focus will go. Some regions manage focus such that there is a single tab stop (or limited number of tab stops) and they may put focus to where the user last had focus within the region.
The default implementation sets focus to the first element in the region that is capable of being tabbed to.
Example
var region = apex.region( "myRegion" );
region.focus();
Removes an event handler from the widget element associated with this region. This method only applies to regions that are implemented with a jQuery UI style widget. This means that region#widgetName property must be defined and the region#widget method returns a value.
This is a shortcut for calling apex.region(id).widget().off(...)
.
Unlike the jQuery object off
method this does not return the
jQuery object and therefore is not chainable. See the jQuery documentation for details.
See also region#on.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
events |
One or more space-separated event types and optional namespaces as defined by the
jQuery off method. For events defined by this region widget the
event name prefix can be omitted. |
||
args |
* |
<repeatable> |
Other arguments to be passed to the widget's jQuery object
off method such as selector, data, and handler. |
Example
apex.region( interactiveGridRegionId ).off( "selectionChange" );
Attaches an event handler to the widget element associated with this region. This method only applies to regions that are implemented with a jQuery UI style widget. This means that region#widgetName property must be defined and the region#widget method returns a value.
This is a shortcut for calling apex.region(id).widget().on(...)
.
Unlike the jQuery object on
method this does not return the
jQuery object and therefore is not chainable. See the jQuery documentation for details.
See also region#off.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
events |
One or more space-separated event types and optional namespaces as defined by the
jQuery on method. For events defined by this region widget the
event name prefix can be omitted. |
||
args |
* |
<repeatable> |
Other arguments to be passed to the widget's jQuery object
on method such as selector, data, and handler. |
Example
apex.region( interactiveGridRegionId ).on( "selectionChange", function(event, data) {
console.log("Selection changed; # records selected is", data.selectedRecords.length );
} );
Cause the region to get new data from the server or otherwise refresh itself. Not all regions support refresh. Exactly what happens depends on the type of region.
This function should be used in place of the legacy way of refreshing a region, which was to trigger the apexrefresh event on the region element.
The default implementation triggers the legacy apexrefresh event on the region element for backward compatibility with old regions that don't implement this interface.
Example
var region = apex.region( "myRegion" );
region.refresh();
Returns the widget associated with the region or null if the region isn't implemented with a widget. Some advanced region types such as Calendar, Interactive Grid, or Tree are implemented using a widget. This function provides access to the widget typically by returning a jQuery object for the widget element. You can then call widget methods on the jQuery object. See also the region#call method.
Returns:
- Type
- jQuery | null
Example
apex.region( "myGridRegion" ).widget().interactiveGrid( "getActions" ).invoke( "selection-add-row" );