i5Grid Object Methods
You can use scripting component methods to return information from an SAP Manufacturing Integration and Intelligence (SAP MII) i5Grid.
The following table lists common i5Grid 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. 1 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 choose it, it returns the index of the last column you selected. |
String getSelectedColumnName() | If the column header is visible and you choose 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. |
void deselectAllRows() | Resets the grid to show no selected rows |
void deleteRow(int row) | Deletes the indicated row |
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 |
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 |
getColumnHeading(colIndex) | Returns the column heading for the index provided. Returns blank if the index value provided is greater than the number of columns. |
String setColumnHeading(colIndex,heading) | Sets the column heading for the |
int setColumnWidth(colIndex,width) | Sets the width provided for the column at |