Constructor
new Grid(npopt)
Created either via call to Grid.create
or Grid.namedValues
, but class can be returned by Grid.module()
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
np |
Object |
<optional> |
named parameters Properties
|
- Source:
Examples
const grid = Grid.create([["one", "two"], [1, 2]]);
for (const {json} of row) {
Logger.log(json); // {one: 1, two: 2}
}
// using calculatedProps
const grid = Grid.create([["one", "two"], [1, 2]], {
sum (json) {
// use header names as keys on json
return json.one + json.two;
}
});
for (const {json} of row) {
Logger.log(json); // {one: 1, two: 2, sum: 3}
}