Layout - HeaderItemBuilder
Layout.HeaderItemBuilderDefine a UI Header container from one or more
Stream's within a LayoutBuilder.Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// a stream containing a number
const number = Stream("My Number Stream", FloatType)
// a stream containing a string
const string = Stream("My String Stream", StringType)
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
)
.header(builder => builder
.value("A percentage", number, (value) => StringJoin`${value}%`)
.value("A string", string)
)
.toTemplate()
Layout
fromStream
▸ fromStream(stream
):
HeaderItemSpecifier
Define the
Stream to build a TableBuilder within a LayoutBuilder.Type parameters
Name | Type |
---|---|
T | extends EastType |
Parameters
Name | Type | Description |
---|---|---|
stream | Stream | the DictType or ArrayType Stream to build the table from |
Returns
HeaderItemSpecifier
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.columns()
)
.toTemplate()