getDataValue( row, fieldName )
This method returns the data value of a specifiedĀ field in a specified row of a grid. In the event that the field name or row number does not exist, null is returned.
The dataĀ doesĀ notĀ need to beĀ visibleĀ (on screen)Ā when calling this method.Ā
For Node.js or RPG Populated Grids Only
This method only works when used where a Node.js or an RPG program is used to populate the grid in Rich Display Files.Ā It will only work on database-driven grids if "load fields into widgets" is enabled.Ā It will not work with Genie generated grids.Ā In the case of database-driven and Genie generated grids, the getCellValue() API would instead be used.
Parameters
row - the row number to retrieve the value from; when using events such as onrowclick, onrowdblclick, onrowmouseover, and onrowmouseout, the row variable is automatically passed into the event and can be used as the parameter to this method
fieldName - field name, as defined in the subfile record format
Returns
field value, if specified field is found onĀ specified row.Ā
null, ifĀ specified field is not found on specified row.
Example
Retrieve the Customer ID from the First Row of the Subfile
var customerId = getObj("Grid1").grid.getDataValue(1, "CUSTID");