Pre-Selecting Rows in a REST Grid Widget

The SelectRowsByData function in the REST Grid widget can be used to select rows in the grid by referring to data in the row to select. This topic describes the function and provides example JavaScript code.

Note: See REST Grid Widget for widget information.

SelectRowsByData(columnName, values, fireEvent)

Name Type Description
columnName String The name of the column to search for the values supplied in the values parameter.
Note: This should be a fully-qualified column name, from the root element down.
values String The values of the given column that correspond to the rows to select.
fireEvent Boolean Whether to fire a selection event when the rows are selected. The default value is false.

Example

This example refers to the Yahoo geocode REST service referenced in Querying REST Service Results. The following code uses the GetWidget Method method. It will select the rows in the grid that correspond to the given values for the "ResultSet.Results.line2" column.

Note: For a process app that demonstrates this functionality, go to solution S138336 in the Knowledgebase at serena.com and download the REST Grid ENH.msd file.
var grid = GetWidget( "RESTGridWidget" );
grid.SelectRowsByData( "ResultSet.Results.line2", ["Springfield, CO", 
"Springfield, ID"], true );