Namespace jQueryModule: jquery.sap.global


Provides base functionality of the SAP jQuery plugin as extension of the jQuery framework.
See also jQuery for details.
Although these functions appear as static ones, they are meant to be used on jQuery instances.
If not stated differently, the functions follow the fluent interface paradigm and return the jQuery instance for chaining of statements.

Example for usage of an instance method:

  var oRect = jQuery("#myDiv").rect();
  alert("Top Position: " + oRect.top);

Namespaces & Classes
EventCheck the jQuery.Event class documentation available under "http://www.jquery.com"
and "http://api.jquery.com/category/events/event-object/" for details.
osHolds information about the current operating system
sapRoot Namespace for the jQuery plug-in provided by SAP SE.
Method Summary
addAriaDescribedBy(sId, bPrepend?)Adds the given ID reference to the aria-describedby attribute.
addAriaLabelledBy(sId, bPrepend?)Adds the given ID reference to the the aria-labelledby attribute.
control(iIndex?)Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context.
cursorPos(iPos)Sets or gets the position of the cursor in an element that supports cursor positioning.
disableSelection()Disable HTML elements selection.
enableSelection()Enable HTML elements to get selected.
firstFocusableDomRef()Returns the first focusable domRef in a given container (the first element of the collection)
getSelectedText()Retrieve the selected text in the first element of the collection.
hasTabIndex()Returns true if the first element has a set tabindex.
lastFocusableDomRef()Returns the last focusable domRef in a given container
outerHTML()Returns the outer HTML of the given HTML element.
parentByAttribute(sAttribute, sValue)Gets the next parent DOM element with a given attribute and attribute value starting above the first given element
rect()Returns a rectangle describing the current visual positioning of the first DOM object in the collection (or null if no element was given).
removeAriaDescribedBy(sId)Removes the given ID reference from the aria-describedby attribute.
removeAriaLabelledBy(sId)Removes the given ID reference from the aria-labelledby attribute.
root(oRootControl)
scrollLeftRTL(iPos)Sets or returns the scrollLeft value of the first element in the given jQuery collection in right-to-left mode.
scrollRightRTL()Returns the MIRRORED scrollLeft value of the first element in the given jQuery collection in right-to-left mode.
selectText(iStart, iEnd)Sets the text selection in the first element of the collection.
uiarea(iIdx)Returns a single UIArea if an index is provided or an array of UIAreas.
zIndex(zIndex)Get the z-index for an element.
Method Detail
addAriaDescribedBy(sId, bPrepend?): jQueryModule: jquery.sap.dom
Adds the given ID reference to the aria-describedby attribute.
Parameters:
stringsIdThe ID reference of an element
booleanbPrepend?, Default: falsewhether prepend or not
Returns:
jQuerythis to allow method chaining.
Since:
1.30.0
addAriaLabelledBy(sId, bPrepend?): jQueryModule: jquery.sap.dom
Adds the given ID reference to the the aria-labelledby attribute.
Parameters:
stringsIdThe ID reference of an element
booleanbPrepend?, Default: falseWhether prepend or not
Returns:
jQuerythis to allow method chaining.
Since:
1.30.0
control(iIndex?): sap.ui.core.Control[]|sap.ui.core.Control|nullModule: jquery.sap.ui
Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context.
Parameters:
intiIndex?Optional parameter to return the control instance at the given index in the array.
Returns:
sap.ui.core.Control[]|sap.ui.core.Control|nullDepending on the given context and index parameter an array of controls, an instance or null.
cursorPos(iPos): int|jQueryModule: jquery.sap.dom
Sets or gets the position of the cursor in an element that supports cursor positioning.
Parameters:
intiPosThe cursor position to set (or no parameter to retrieve the cursor position)
Returns:
int|jQueryThe cursor position (or the jQuery collection if the position has been set)
Since:
0.9.0
disableSelection(): jQueryModule: jquery.sap.dom
Disable HTML elements selection.
Returns:
jQuerythis to allow method chaining.
Since:
1.24.0
enableSelection(): jQueryModule: jquery.sap.dom
Enable HTML elements to get selected.
Returns:
jQuerythis to allow method chaining.
Since:
1.24.0
firstFocusableDomRef(): ElementModule: jquery.sap.dom
Returns the first focusable domRef in a given container (the first element of the collection)
Returns:
ElementThe domRef
Since:
0.9.0
getSelectedText(): stringModule: jquery.sap.dom

Retrieve the selected text in the first element of the collection.

Note: This feature is only supported for input element’s type of text, search, url, tel and password.

Returns:
stringThe selected text.
Since:
1.26.0
hasTabIndex(): booleanModule: jquery.sap.dom
Returns true if the first element has a set tabindex.
Returns:
booleanIf the first element has a set tabindex
Since:
0.9.0
lastFocusableDomRef(): ElementModule: jquery.sap.dom
Returns the last focusable domRef in a given container
Returns:
ElementThe last domRef
Since:
0.9.0
outerHTML(): stringModule: jquery.sap.dom
Returns the outer HTML of the given HTML element.
Returns:
stringouter HTML
Since:
0.9.0
parentByAttribute(sAttribute, sValue): ElementModule: jquery.sap.dom
Gets the next parent DOM element with a given attribute and attribute value starting above the first given element
Parameters:
stringsAttributeName of the attribute
stringsValueValue of the attribute (optional)
Returns:
Elementnull or the DOM reference
Since:
0.9.0
rect(): objectModule: jquery.sap.dom
Returns a rectangle describing the current visual positioning of the first DOM object in the collection (or null if no element was given).
Returns:
objectAn object with left, top, width and height
Since:
0.9.0
removeAriaDescribedBy(sId): jQueryModule: jquery.sap.dom
Removes the given ID reference from the aria-describedby attribute.
Parameters:
stringsIdThe ID reference of an element
Returns:
jQuerythis to allow method chaining.
Since:
1.30.0
removeAriaLabelledBy(sId): jQueryModule: jquery.sap.dom
Removes the given ID reference from the aria-labelledby attribute.
Parameters:
stringsIdThe ID reference of an element
Returns:
jQuerythis to allow method chaining.
Since:
1.30.0
root(oRootControl): jQueryModule: jquery.sap.ui
Parameters:
objectoRootControlThe root control
Returns:
jQueryReturns itself
scrollLeftRTL(iPos): jQuery|intModule: jquery.sap.dom

Sets or returns the scrollLeft value of the first element in the given jQuery collection in right-to-left mode. Precondition: The element is rendered in RTL mode.

Reason for this method is that the major browsers use three different values for the same scroll position when in RTL mode. This method hides those differences and returns/applies the same value that would be returned in LTR mode: The distance in px how far the given container is scrolled away from the leftmost scroll position.

Returns "undefined" if no element and no iPos is given.

Parameters:
intiPosThe desired scroll position
Returns:
jQuery|intThe jQuery collection if iPos is given, otherwise the scroll position, counted from the leftmost position
Since:
0.20.0
scrollRightRTL(): intModule: jquery.sap.dom

Returns the MIRRORED scrollLeft value of the first element in the given jQuery collection in right-to-left mode. Precondition: The element is rendered in RTL mode.

Reason for this method is that the major browsers return three different values for the same scroll position when in RTL mode. This method hides those differences and returns the value that would be returned in LTR mode if the UI would be mirrored horizontally: The distance in px how far the given container is scrolled away from the rightmost scroll position.

Returns "undefined" if no element is given.

Returns:
intThe scroll position, counted from the rightmost position
Since:
0.20.0
selectText(iStart, iEnd): jQueryModule: jquery.sap.dom

Sets the text selection in the first element of the collection.

Note: This feature is only supported for input element’s type of text, search, url, tel and password.

Parameters:
intiStartStart position of the selection (inclusive)
intiEndEnd position of the selection (exclusive)
Returns:
jQueryThe jQuery collection
Since:
0.9.0
uiarea(iIdx): Object|ArrayModule: jquery.sap.ui
Returns a single UIArea if an index is provided or an array of UIAreas.
Parameters:
intiIdxIndex of the UIArea
Returns:
Object|ArrayThe UIArea if an index is provided or an array of UIAreas
zIndex(zIndex): numberModule: jquery.sap.dom
Get the z-index for an element.
Parameters:
intzIndexThe z-index to set
Returns:
numberThe z-index