isRowSelected

Checks if a row in a grid is selected or not.

Parameters

  1. controlId - The id of the grid

  2. line - This can be either a whole line from a "myGrid.allRows" call or a single id from a record.

Example Usages

let result = app.isRowSelected("myGrid", myLine);

Used in a loop

let allRows = app.getFieldValue("myGrid.allRows");
for (let i = 0; i < allRows.length; i++) {
  if (app.isRowSelected("myGrid", allRows[i])) {
    console.log("This is selected: " + line.id);
  }
}

In this case, "allRows" is an array which contains the rows of "myGrid". We iterate through the array with the given for loop.

Used with an id

let result = app.isRowSelected("myGrid", 123); //Checks if the line with the id 123 is selected.

Return Values

The function returns a boolean value, either true or false.

Last updated