Layout - PagedLayoutBuilder
Layout.PagedLayoutBuilderA
LayoutBuilder to display in the UI from a TableBuilder.Hierarchy
-
Builder
↳
PagedLayoutBuilder
Layout
page
▸ page(name
, def
):
PagedLayoutBuilder
Add a new Page from a
LayoutBuilder to display in the UI from a TabBuilder.Parameters
Name | Type | Description |
---|---|---|
name | string | - |
def | (panel : FlatLayoutBuilder ) => FlatLayoutFinalizer | the TabBuilder to embed. |
Returns
PagedLayoutBuilder
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")
.page("Page One", builder => builder
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
)
)
.page("Page Two", builder => builder
.table("My Other Table", builder => builder
.fromStream(stream)
.columns()
)
)
.toTemplate()
toTemplate
▸ toTemplate():
Template
Convert the built layout into an
Template, for usage in an EDK project.Returns
Template
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// add a form to a tab
const layout = new LayoutBuilder("My Layout")
.table(50, "My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
)
.toTemplate()
Overrides
Builder.toTemplate