Function documentationiGrid Component Methods

 

You can use scripting component methods to return information from an SAP Manufacturing Integration and Intelligence (SAP MII) grid.

Features

The following table lists common iGrid component methods:

Method

Use

int getRowCount()

Returns the number of rows, excluding the header row

int getColumnCount()

Returns the number of columns

int getVisibleRows()

Returns the number of visible rows

int getFirstVisibleRow()

Returns the number of the first visible row. One represents the first row. You can use this method with grid scrolling.

int setFirstVisibleRow(int intIndex)

Changes the display so the first visible row is at the specified index

int getSelectedRow()

Returns the number of the last row you selected. Zero indicates that no row was selected.

void setSelectedRow(int row)

Sets the selected row in the grid parameter

int getSelectedCellRow()

If AllowCellSelection is enabled, it returns the row number of the selected cell.

int getSelectedCellColumn()

If AllowCellSelection is enabled, it returns the column number of the selected cell.

String getCellValue(int row, int col)

Returns the cell value as a string

String getSelectedCellValue(int col)

Returns the column value of the selected row as a string

void setCellValue(int Row, int Column, String Value)

Sets the cell value to the specified value

int getSelectedColumn()

If the column header is visible and you clicked it, it returns the index of the last column you selected.

String getSelectedColumnName()

If the column header is visible and you click it, it returns the name of the last column you selected.

String getColumnName(int colNum)

Returns the column name of the specified index

int getSelectedRowCount()

Returns the number of selected rows

int getSelectedRowAt(int intIndex)

Enumerates the selected row numbers. Used with getSelectedRowCount(). Returned values can be used with getCellValue, setCellValue, and other methods to read from or write to the grid.

boolean getFreeze(int intColumn)

Returns true if the column at the indicated index is frozen

String setFreeze(int intIndex, boolean bValue)

Sets the freeze attribute for a column to the specified Boolean value. You can only freeze columns from left to right without gaps.

void deselectAllRows()

Resets the grid to show no selected rows

void resetColorContext()

Resets the color contexting to the template settings

void deleteRow(int row)

Deletes the indicated row

void setCellColor(int row,int col,Color colorNew)

Sets the text color for the indicated cell

void setCellBackgroundColor(int row,int col,Color colorNew)

Sets the color for the indicated cell

void setCellColorAsString(int row,int col,String sColorNew)

Creates a color based on the sColorNew string parameter and sets the cell text color

void setCellBackgroundColorAsString(int row,int col,String sColorNew)

Creates a color based on the sColorName string parameter and sets the cell background color

void setSelectedCell(int Row,int Column)

Sets the selected cell to the indicated row and column number

int findColumnNumber(String sColName)

Returns the column number index based on the given column name

String getCellValueByName(int row,String sColName)

Returns the string value of a cell based on a row number and column name

String getSelectedCellValueByName(String sColName)

Returns a cell value as a string based on the selected row and the given column heading name