Returns an array of GridRow objects for all selected records in the data grid on the List page.
Note: The selected records are the ones that have the checkbox next to them selected.
Syntax
getSelectedRecords();
Arguments
No arguments
Return value
Returns an array of GridRow objects for all selected records in the data grid on the List page.
Example
Let us assume you would like to highlight some important information on the web page.
Changing the look of the records may come in handy in this scenario.
In this example, we create a Сustom button that allows us to change the background color of the selected records.
Client before:
var selectedRecords = pageObj.getSelectedRecords();
if( selectedRecords.length == 0 )
return false;
selectedRecords.forEach( function( row, idx ) {
$("[data-record-id="+row.recordId()+"]").css("background-color","red");
});
return false;
See also:
•JavaScript API: RunnerPage object > getSelectedRecordKeys()
•Button object: getNextSelectedRecord()
•JavaScript API: RunnerPage object