Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


titleContent Freeze


The getRecords() method extracts all records from a grid and returns them as an array.

The array is a copy of the records. Modifying the array does not modify the grid records directly. You may, however, modify the array and then place it back into the grid using the display.grid.replaceRecords() API.


Return Value

An array containing the extracted records. Each array element is a JavaScript object with properties for each field in the grid.


Code Block
pjs.defineDisplay("display.json");  // assume display.json defines mygrid with fields named "product" and "description"

product = 1;
description = "ONE"; 
product = 2;
description = "TWO"; 
// The line above will log the following output:
// [ { product: 1, description: "ITEM ONE" },
//   { product: 2, description: "ITEM TWO" } ]