Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > RunnerPage object > Methods

JavaScript API: RunnerPage object > getSelectedRecords()

Scroll Prev Next More

 

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()

Select multiple values from checkboxes or a list field and have them appear as individual database entries

Click actions

AJAX-based functionality

AJAX helper object

Events: JavaScript onload

Customizing CSS examples

JavaScript API: RunnerPage object

JavaScript API