Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

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.

Properties:
Name Default Value Description
version : number

The version of the table specification format.

Currently, the only possible value is 3.

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.<pentaho.data.spec.PlainColumn>

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:

  • the columns order is different from the model attributes order
  • not all attributes of the model are exposed as columns

To specify a table with no columns (initially, that is), specify an empty array.

rows : Array.<pentaho.data.spec.Row>

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]}
 ]
 };