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");