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. supportHolds information about the browser's capabilities and quirks. Method Summary
addAriaLabelledBy(sID)Adds the given ID reference to the the aria-labelledby attribute. control(idx?)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 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 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) rectContains(iPosX, iPosY)Returns whether a point described by X and Y is inside this Rectangle's boundaries 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. Method Detail
Adds the given ID reference to the aria-describedby attribute.
Parameters:
{string} | sID | The ID reference of an element |
- Since:
- 1.30.0
Returns:
{jQuery} | this to allow method chaining. |
Adds the given ID reference to the the aria-labelledby attribute.
Parameters:
{string} | sID | The ID reference of an element |
- Since:
- 1.30.0
Returns:
{jQuery} | this to allow method chaining. |
Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context.
Parameters:
{int} | idx? | optional parameter to return the control instance at the given idx's position in the array. |
Returns:
Sets or gets the position of the cursor in an element that supports cursor positioning
Parameters:
{int} | iPos | The cursor position to set (or no parameter to retrieve the cursor position) |
- Since:
- 0.9.0
Returns:
{int|jQuery} | The cursor position (or the jQuery collection if the position has been set) |
Disable HTML elements selection.
- Since:
- 1.24.0
Returns:
{jQuery} | this to allow method chaining. |
Enable HTML elements to get selected.
- Since:
- 1.24.0
Returns:
{jQuery} | this to allow method chaining. |
Returns the first focusable domRef in a given container (the first element of the collection)
- Since:
- 0.9.0
Returns:
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.
- Since:
- 1.26.0
Returns:
{string} | The selected text. |
Returns true if the first element has a set tabindex
- Since:
- 0.9.0
Returns:
{boolean} | If the first element has a set tabindex |
Returns the last focusable domRef in a given container
- Since:
- 0.9.0
Returns:
{Element} | The last domRef |
Returns the outer HTML of the given HTML element
- Since:
- 0.9.0
Returns:
Gets the next parent DOM element with a given attribute and attribute value starting above the first given element
Parameters:
{string} | sAttribute | Name of the attribute |
{string} | sValue | Value of the attribute (optional) |
- Since:
- 0.9.0
Returns:
{Element} | null or the DOM reference |
Returns a rectangle describing the current visual positioning of the first DOM object in the collection (or null if no element was given)
- Since:
- 0.9.0
Returns:
{object} | An object with left, top, width and height |
Returns whether a point described by X and Y is inside this Rectangle's boundaries
Parameters:
- Since:
- 0.18.0
Returns:
{boolean} | Whether X and Y are inside this Rectangle's boundaries |
Removes the given ID reference from the aria-describedby attribute.
Parameters:
{string} | sID | The ID reference of an element |
- Since:
- 1.30.0
Returns:
{jQuery} | this to allow method chaining. |
Removes the given ID reference from the aria-labelledby attribute.
Parameters:
{string} | sID | The ID reference of an element |
- Since:
- 1.30.0
Returns:
{jQuery} | this to allow method chaining. |
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:
- Since:
- 0.20.0
Returns:
{jQuery|int} | The jQuery collection if iPos is given, otherwise the scroll position, counted from the leftmost position |
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.
- Since:
- 0.20.0
Returns:
{int} | The scroll position, counted from the rightmost position |
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:
{int} | iStart | Start position of the selection (inclusive) |
{int} | iEnd | End position of the selection (exclusive) |
- Since:
- 0.9.0
Returns:
{jQuery} | The jQuery collection |