# Class OjDataGrid

The component WebElement for oj-data-grid. Do not instantiate this class directly, instead, use ojDataGrid.

#### Hierarchy

- OjDataGridBase
  - OjDataGrid

#####
Index

### Constructors

constructor

### Methods

changeCurrentCell
changeEditMode
changeFrozenColumnCount
changeFrozenRowCount
changeScrollPosition
changeSelection
clear
click
findCell
findElement
findElements
findHeader
findLabel
getAttribute
getBandingInterval
getCell
getCellContents
getCssValue
getCurrentCell
getDataTransferOptions
getDnd
getDriver
getEditMode
getFrozenColumnCount
getFrozenRowCount
getGridlines
getHeader
getHeaderContents
getId
getLabelContents
getLocation
getProperty
getRect
getScrollPolicy
getScrollPolicyOptions
getScrollPosition
getScrollToKey
getSelection
getSelectionMode
getShadowRoot
getSize
getTagName
getText
getTranslations
hasSize
hasVisibility
isDisplayed
isEnabled
isSelected
sendKeys
serialize
setProperty
submit
takeScreenshot
whenBusyContextReady
whenReady
buildId
equals
extractId
isId

## Constructors

### constructor

- new OjDataGrid(el, locators): OjDataGrid

- Constructor. Pass an instance of WebDriver's WebElement that represents the DOM node on which we"ll perform operations.

  #### Parameters

  - ##### el: WebElement

    The basic WebElement with which this WebElement will work.

  - ##### locators: ElementLocators

  #### Returns OjDataGrid

  Inherited from OjDataGridBase.constructor

## Methods

### changeCurrentCell

- changeCurrentCell(currentCell): Promise<void>

- Sets the value of `currentCell` property. Specifies the grid's currently focused cell.

  #### Parameters

  - ##### currentCell: object

    The value to set for `currentCell`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeCurrentCell

### changeEditMode

- changeEditMode(editMode): Promise<void>

- Sets the value of `editMode` property. Specifies if the grid is read-only or editable.

  #### Parameters

  - ##### editMode: string

    The value to set for `editMode`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeEditMode

### changeFrozenColumnCount

- changeFrozenColumnCount(frozenColumnCount): Promise<void>

- Sets the value of `frozenColumnCount` property. Specifies count of columns to be frozen.

  #### Parameters

  - ##### frozenColumnCount: number

    The value to set for `frozenColumnCount`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeFrozenColumnCount

### changeFrozenRowCount

- changeFrozenRowCount(frozenRowCount): Promise<void>

- Sets the value of `frozenRowCount` property. Specifies count of rows to be frozen.

  #### Parameters

  - ##### frozenRowCount: number

    The value to set for `frozenRowCount`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeFrozenRowCount

### changeScrollPosition

- changeScrollPosition(scrollPosition): Promise<void>

- Sets the value of `scrollPosition` property. Specifies the current scroll position of the data grid. See the Help documentation for more information.

  #### Parameters

  - ##### scrollPosition: ScrollPosition

    The value to set for `scrollPosition`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeScrollPosition

### changeSelection

- changeSelection(selection): Promise<void>

- Sets the value of `selection` property. Specifies the grid's current selection.

  #### Parameters

  - ##### selection: object[]

    The value to set for `selection`

  #### Returns Promise<void>

  Inherited from OjDataGridBase.changeSelection

### clear

- clear(): Promise<void>

- ### Inherit Doc

  #### Returns Promise<void>

  Inherited from OjDataGridBase.clear

### click

- click(): Promise<void>

- ### Inherit Doc

  #### Returns Promise<void>

  Inherited from OjDataGridBase.click

### findCell

- findCell(itemLocator): Promise<SlotProxy>

- #### Parameters

  - ##### itemLocator: cellSubId

  #### Returns Promise<SlotProxy>

### findElement

- findElement(locator): WebElementPromise

- ### Inherit Doc

  #### Parameters

  - ##### locator: Locator

  #### Returns WebElementPromise

  Inherited from OjDataGridBase.findElement

### findElements

- findElements(locator): Promise<WebElement[]>

- ### Inherit Doc

  #### Parameters

  - ##### locator: Locator

  #### Returns Promise<WebElement[]>

  Inherited from OjDataGridBase.findElements

### findHeader

- findHeader(itemLocator): Promise<SlotProxy>

- #### Parameters

  - ##### itemLocator: headerSubId

  #### Returns Promise<SlotProxy>

### findLabel

- findLabel(itemLocator): Promise<SlotProxy>

- #### Parameters

  - ##### itemLocator: labelSubId

  #### Returns Promise<SlotProxy>

### getAttribute

- getAttribute(attributeName): Promise<string>

- ### Inherit Doc

  #### Parameters

  - ##### attributeName: string

  #### Returns Promise<string>

  Inherited from OjDataGridBase.getAttribute

### getBandingInterval

- getBandingInterval(): Promise<BandingInterval>

- Gets the value of `bandingInterval` property. Specifies the data body row and column banding intervals.

  #### Returns Promise<BandingInterval>

  The value of `bandingInterval` property.

  Inherited from OjDataGridBase.getBandingInterval

### getCell

- getCell(): Promise<Cell>

- Gets the value of `cell` property. Specifies attributes on the cells.

  #### Returns Promise<Cell>

  The value of `cell` property.

  Inherited from OjDataGridBase.getCell

### getCellContents

- getCellContents(itemLocator): Promise<WebElement>

- This method exists to get content that is intended to interact with. This is not a method to verify data or that template rendering is correct. For those cases unit test the data, template, style function etc.

  ### Ojdeprecated

  #### Parameters

  - ##### itemLocator: {
    key: cellSubId;
    }

    - ##### key: cellSubId

  #### Returns Promise<WebElement>

  If no cell is found matching the id, returns null. Otherwise: On Zero Match return an empty list. On One Match returns list of one WebElement only. On One+ Match returns list with all matching instance. If cell renderer/template/slot is not specified the promise will be rejected with an error message.

### getCssValue

- getCssValue(cssStyleProperty): Promise<string>

- ### Inherit Doc

  #### Parameters

  - ##### cssStyleProperty: string

  #### Returns Promise<string>

  Inherited from OjDataGridBase.getCssValue

### getCurrentCell

- getCurrentCell(): Promise<object>

- Gets the value of `currentCell` property. Specifies the grid's currently focused cell.

  #### Returns Promise<object>

  The value of `currentCell` property.

  Inherited from OjDataGridBase.getCurrentCell

### getDataTransferOptions

- getDataTransferOptions(): Promise<DataTransferOptions>

- Gets the value of `dataTransferOptions` property. Specifies data transfer features.

  #### Returns Promise<DataTransferOptions>

  The value of `dataTransferOptions` property.

  Inherited from OjDataGridBase.getDataTransferOptions

### getDnd

- getDnd(): Promise<Dnd>

- Gets the value of `dnd` property. Specifies drag and drop features.

  #### Returns Promise<Dnd>

  The value of `dnd` property.

  Inherited from OjDataGridBase.getDnd

### getDriver

- getDriver(): WebDriver

- #### Returns WebDriver

  The parent driver for this instance.

  Inherited from OjDataGridBase.getDriver

### getEditMode

- getEditMode(): Promise<string>

- Gets the value of `editMode` property. Specifies if the grid is read-only or editable.

  #### Returns Promise<string>

  The value of `editMode` property.

  Inherited from OjDataGridBase.getEditMode

### getFrozenColumnCount

- getFrozenColumnCount(): Promise<number>

- Gets the value of `frozenColumnCount` property. Specifies count of columns to be frozen.

  #### Returns Promise<number>

  The value of `frozenColumnCount` property.

  Inherited from OjDataGridBase.getFrozenColumnCount

### getFrozenRowCount

- getFrozenRowCount(): Promise<number>

- Gets the value of `frozenRowCount` property. Specifies count of rows to be frozen.

  #### Returns Promise<number>

  The value of `frozenRowCount` property.

  Inherited from OjDataGridBase.getFrozenRowCount

### getGridlines

- getGridlines(): Promise<Gridlines>

- Gets the value of `gridlines` property. Specifies the visibility of the grid body vertical and horizontal gridlines.

  #### Returns Promise<Gridlines>

  The value of `gridlines` property.

  Inherited from OjDataGridBase.getGridlines

### getHeader

- getHeader(): Promise<Header>

- Gets the value of `header` property. Specifies attributes on the headers.

  #### Returns Promise<Header>

  The value of `header` property.

  Inherited from OjDataGridBase.getHeader

### getHeaderContents

- getHeaderContents(subId, by): Promise<WebElement[]>

- This method exists to get content that is intended to interact with. This is not a method to verify data or that template rendering is correct. For those cases unit test the data, template, style function etc.

  ### Ojdeprecated

  #### Parameters

  - ##### subId: headerSubId

    information about the header to get contents of, if level not specified will default to 0

  - ##### by: By

    The lookup to pass into findElements

  #### Returns Promise<WebElement[]>

  If no header is found matching the id, returns null. Otherwise: On Zero Match return an empty list. On One Match returns list of one WebElement only. On One+ Match returns list with all matching instance. If header renderer/template/slot is not specified the promise will be rejected with an error message.

### getId

- getId(): Promise<string>

- #### Returns Promise<string>

  A promise that resolves to the server-assigned opaque ID assigned to this element.

  Inherited from OjDataGridBase.getId

### getLabelContents

- getLabelContents(subId, by): Promise<WebElement[]>

- This method exists to get content that is intended to interact with. This is not a method to verify data or that template rendering is correct. For those cases unit test the data, template, style function etc.

  ### Ojdeprecated

  #### Parameters

  - ##### subId: labelSubId

    information about the label to get contents of, if level not specified will default to 0

  - ##### by: By

    The lookup to pass into findElements

  #### Returns Promise<WebElement[]>

  If no label is found matching the id, returns null. Otherwise: On Zero Match return an empty list. On One Match returns list of one WebElement only. On One+ Match returns list with all matching instance. If label renderer/template/slot is not specified the promise will be rejected with an error message.

### getLocation

- getLocation(): Promise<ILocation>

- ### Inherit Doc

  #### Returns Promise<ILocation>

  Inherited from OjDataGridBase.getLocation

### getProperty

- getProperty<T>(propertyName): Promise<T>

- Get a named property value from this component. This function will wait for the application's busy context to complete before attempting to get the property value.

  #### Type Parameters

  - #### T = string

  #### Parameters

  - ##### propertyName: string

    The name of the property

  #### Returns Promise<T>

  A Promise that yields a value for the named property.

  Inherited from OjDataGridBase.getProperty

### getRect

- getRect(): Promise<IRectangle>

- ### Inherit Doc

  #### Returns Promise<IRectangle>

  Inherited from OjDataGridBase.getRect

### getScrollPolicy

- getScrollPolicy(): Promise<string>

- Gets the value of `scrollPolicy` property. Specifies how data are fetched as user scrolls through the data grid.

  #### Returns Promise<string>

  The value of `scrollPolicy` property.

  Inherited from OjDataGridBase.getScrollPolicy

### getScrollPolicyOptions

- getScrollPolicyOptions(): Promise<ScrollPolicyOptions>

- Gets the value of `scrollPolicyOptions` property. Specifies fetch options for scrolling behaviors that trigger data fetches.

  #### Returns Promise<ScrollPolicyOptions>

  The value of `scrollPolicyOptions` property.

  Inherited from OjDataGridBase.getScrollPolicyOptions

### getScrollPosition

- getScrollPosition(): Promise<ScrollPosition>

- Gets the value of `scrollPosition` property. Specifies the current scroll position of the data grid. See the Help documentation for more information.

  #### Returns Promise<ScrollPosition>

  The value of `scrollPosition` property.

  Inherited from OjDataGridBase.getScrollPosition

### getScrollToKey

- getScrollToKey(): Promise<string>

- Gets the value of `scrollToKey` property. Specifies the behavior when DataGrid needs to scroll to a position based on a row/column key.

  #### Returns Promise<string>

  The value of `scrollToKey` property.

  Inherited from OjDataGridBase.getScrollToKey

### getSelection

- getSelection(): Promise<object[]>

- Gets the value of `selection` property. Specifies the grid's current selection.

  #### Returns Promise<object[]>

  The value of `selection` property.

  Inherited from OjDataGridBase.getSelection

### getSelectionMode

- getSelectionMode(): Promise<SelectionMode>

- Gets the value of `selectionMode` property. Specifies the row and cell selection modes. See the Help documentation for more information.

  #### Returns Promise<SelectionMode>

  The value of `selectionMode` property.

  Inherited from OjDataGridBase.getSelectionMode

### getShadowRoot

- getShadowRoot(): ShadowRootPromise

- Get the shadow root of the current web element.

  #### Returns ShadowRootPromise

  A promise that will be resolved with the elements shadow root or rejected with NoSuchShadowRootError

  Inherited from OjDataGridBase.getShadowRoot

### getSize

- getSize(): Promise<ISize>

- ### Inherit Doc

  #### Returns Promise<ISize>

  Inherited from OjDataGridBase.getSize

### getTagName

- getTagName(): Promise<string>

- Schedules a command to query for the tag/node name of this element.

  #### Returns Promise<string>

  A promise that will be resolved with the element's tag name.

  Inherited from OjDataGridBase.getTagName

### getText

- getText(): Promise<string>

- ### Inherit Doc

  #### Returns Promise<string>

  Inherited from OjDataGridBase.getText

### getTranslations

- getTranslations(): Promise<Translations>

- Gets the value of `translations` property. A collection of translated resources from the translation bundle, or null if this component has no resources.

  #### Returns Promise<Translations>

  The value of `translations` property.

  Inherited from OjDataGridBase.getTranslations

### `Protected` hasSize

- hasSize(): Condition<Promise<boolean>>

- Create a wait condition that is satisfied when the element's DOM has a non-zero size.

  ### Deprecated

  Since 11.0.0. Call the appropriate WebElement method to test the size of the element.

  #### Returns Condition<Promise<boolean>>

  The Condition to be used with driver.wait() that's satisfied when the element's DOM has a non-zero size.

  Inherited from OjDataGridBase.hasSize

### `Protected` hasVisibility

- hasVisibility(): Condition<Promise<boolean>>

- Create a wait condition that is satisfid when the element is visible. The condition is satisfied when the element is displayed, as reported by #isDisplayed, and is scrolled into view. This is method is deprecated. Use WebElement.isDisplayed instead to test the display of the element, and scroll it into view if necessary.

  ### Deprecated

  #### Returns Condition<Promise<boolean>>

  Inherited from OjDataGridBase.hasVisibility

### isDisplayed

- isDisplayed(): Promise<boolean>

- ### Inherit Doc

  #### Returns Promise<boolean>

  Inherited from OjDataGridBase.isDisplayed

### isEnabled

- isEnabled(): Promise<boolean>

- ### Inherit Doc

  #### Returns Promise<boolean>

  Inherited from OjDataGridBase.isEnabled

### isSelected

- isSelected(): Promise<boolean>

- ### Inherit Doc

  #### Returns Promise<boolean>

  Inherited from OjDataGridBase.isSelected

### sendKeys

- sendKeys(...varArgs): Promise<void>

- ### Inherit Doc

  #### Parameters

  - ##### `Rest` ...varArgs: (string | number | Promise<string | number>)[]

  #### Returns Promise<void>

  Inherited from OjDataGridBase.sendKeys

### serialize

- serialize(): Promise<IWebElementId>

- #### Returns Promise<IWebElementId>

  Inherited from OjDataGridBase.serialize

### `Protected` setProperty

- setProperty<T>(propertyName, value): Promise<void>

- Set a property value on the remote element. This function first waits for the BusyContext to clear before setting the property, then after setting, waits again to ensure that no additional busy states were created due to the property setting.

  #### Type Parameters

  - #### T = string

  #### Parameters

  - ##### propertyName: string

    The property name to set

  - ##### value: T

    The value to set for the property

  #### Returns Promise<void>

  A Promise which resolves when the remote property has been set to the value. Any value returned from the call to set the remote property is returned in the Promise.

  Inherited from OjDataGridBase.setProperty

### submit

- submit(): Promise<void>

- ### Inherit Doc

  #### Returns Promise<void>

  Inherited from OjDataGridBase.submit

### takeScreenshot

- takeScreenshot(optScroll?): Promise<string>

- ### Inherit Doc

  #### Parameters

  - ##### `Optional` optScroll: boolean

  #### Returns Promise<string>

  Inherited from OjDataGridBase.takeScreenshot

### whenBusyContextReady

- whenBusyContextReady(): Promise<void>

- Returns a Promise that is resolved when the application's busy state reports ready. This method checks only that the application's busy context is ready, and not that the DOM element is actually displayed or has a physical size, such as is the case with #whenReady. Operations which are read-only in nature should call this method prior to execution.

  #### Returns Promise<void>

  A Promise which is resolved when the page's busy state is ready.

  Inherited from OjDataGridBase.whenBusyContextReady

### whenReady

- whenReady(): Promise<void>

- Returns a Promise that is resolved when the element is ready for interaction--it is visible, has a size, and the app's busy context is ready. Operations on the DOM which rely on its physical location and size to be in a "ready" state should use this command, such as clicking, sending keys, locating child elements, and so on.

  #### Returns Promise<void>

  A Promise that's resolved when all conditions are met.

  Inherited from OjDataGridBase.whenReady

### `Static` buildId

- buildId(id, opt_noLegacy?): IWebElementId

- #### Parameters

  - ##### id: string

    The raw ID.

  - ##### `Optional` opt_noLegacy: boolean

    Whether to exclude the legacy element key.

  #### Returns IWebElementId

  The element ID for use with WebDriver's wire protocol.

  Inherited from OjDataGridBase.buildId

### `Static` equals

- equals(a, b): Promise<boolean>

- Compares two WebElements for equality.

  #### Parameters

  - ##### a: WebElement

    A WebElement.

  - ##### b: WebElement

    A WebElement.

  #### Returns Promise<boolean>

  A promise that will be resolved to whether the two WebElements are equal.

  Inherited from OjDataGridBase.equals

### `Static` extractId

- extractId(obj): string

- Extracts the encoded WebElement ID from the object.

  ### Throws

  if the object is not a valid encoded ID.

  #### Parameters

  - ##### obj: IWebElementId

    The object to extract the ID from.

  #### Returns string

  the extracted ID.

  Inherited from OjDataGridBase.extractId

### `Static` isId

- isId(obj): boolean

- #### Parameters

  - ##### obj: IWebElementId

    the object to test.

  #### Returns boolean

  whether the object is a valid encoded WebElement ID.

  Inherited from OjDataGridBase.isId

Generated using TypeDoc