IPlainTable
IPlainTable
The spec.IPlainTable
interface describes the structure of a specification of a table with a plain structure.
A table with a plain structure is a table in which its structure (or layout) is perfectly aligned with its model, i.e., each row represents a single and distinct model entity and, each column, a single model attribute.
Name | Default Value | Description |
---|---|---|
version : number | The version of the table specification format. Currently, the only possible value is When unspecified, the latest version is assumed, whatever it is at the time. | |
model : pentaho.data.spec.IModel | The model specification. Can be empty or not be specified at all. | |
cols : Array.< | An array of plain column specifications. When unspecified, columns are built to match the attributes of the model, one column per model attribute, in the same order. You only need to specify columns if:
To specify a table with no columns (initially, that is), specify an empty array. | |
rows : Array.< | An array of row specifications. Can be empty or not be specified at all. |
Source: doc-js/pentaho/data/spec/IPlainTable.jsdoc, line 17
Example
A plain table specification with default columns
var plainTableSpec = { model: { attrs: [ { name: "product", label: "Product", type: "string", members: [ {v: "car", f: "Car", }, {v: "plane", f: "Plane"} ] }, { name: "price", label: "Price", type: "number" } ], p: { "foo": 1, "bar": 2 } }, rows: [ {c: ["car", 1000]}, {c: ["plain", 50000]} ] };