Skip to main content

Layout - FlatLayoutFinalizer

Layout.FlatLayoutFinalizer

A

LayoutBuilder to display in the UI from a TableBuilder.

Type parameters

NameType
Textends FlatLayoutBuilderType = FlatLayoutBuilderType

Hierarchy

  • Builder

    FlatLayoutFinalizer

Layout

chat

chat(def):

FlatLayoutFinalizer

Add a

HeaderBuilder to display in the Layout.

Parameters

NameTypeDescription
def(panel: ChatBuilder) => ChatBuilderthe HeaderBuilder to embed.

Returns

FlatLayoutFinalizer

Example

  // use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
float: FloatType,
min_float: FloatType,
max_float: FloatType,
integer: IntegerType,
boolean: BooleanType,
})
)
);

// 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)
.string("String", fields => fields.string)
.integer("Integer", fields => fields.integer)
.boolean("Boolean", fields => fields.boolean)
)
.header(builder => builder
.item("A number", number)
.item("A string", string)

)
.toTemplate()

downloadsToolbar

downloadsToolbar(show):

FlatLayoutFinalizer

Define if the

Task button and menu will visible within a LayoutBuilder.

Parameters

NameTypeDescription
showfalsetoolbar button will be displayed if true

Returns

FlatLayoutFinalizer

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)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.showKey(false)
)
.downloadsToolbar(true, {
label: "Tasks",
streams: {
"My STream": stream
}
})
.toTemplate()

errorsToolbar

errorsToolbar(show):

FlatLayoutFinalizer

Define if the

Task button and menu will visible within a LayoutBuilder.

Parameters

NameTypeDescription
showfalsetoolbar button will be displayed if true

Returns

FlatLayoutFinalizer

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)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.showKey(false)
)
.errorsToolbar(true, { label: "Problems" })
.toTemplate()

header(def):

FlatLayoutFinalizer

Add a

HeaderBuilder to display in the Layout.

Parameters

NameTypeDescription
def(panel: HeaderBuilder) => HeaderBuilderthe HeaderBuilder to embed.

Returns

FlatLayoutFinalizer

Example

  // use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
float: FloatType,
min_float: FloatType,
max_float: FloatType,
integer: IntegerType,
boolean: BooleanType,
})
)
);

// 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)
.string("String", fields => fields.string)
.integer("Integer", fields => fields.integer)
.boolean("Boolean", fields => fields.boolean)
)
.header(builder => builder
.item("A number", number)
.item("A string", string)

)
.toTemplate()

targetsToolbar

targetsToolbar(show):

FlatLayoutFinalizer

Define if the

Stream targets button and menu will visible within a LayoutBuilder.

Parameters

NameTypeDescription
showfalsetoolbar button will be displayed if true

Returns

FlatLayoutFinalizer

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)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.showKey(false)
)
.targetsToolbar(true, { label: "Recommendations", show_targets: true })
.toTemplate()

tasksToolbar

tasksToolbar(show):

FlatLayoutFinalizer

Define if the

Task button and menu will visible within a LayoutBuilder.

Parameters

NameTypeDescription
showfalsetoolbar button will be displayed if true

Returns

FlatLayoutFinalizer

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)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.showKey(false)
)
.tasksToolbar(true, { label: "Tasks", show_idle: false })
.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