Constructor
new TextComponent(optionsopt)
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} | see the Component options
Properties
|
- Source:
Examples
Show static text
const textComponent = new TextComponent(undefined, {
text: 'Static text goes here'
})
Show dynamically bound text
const textComponent = new TextComponent(myDataModel, {
dataField: 'title'
})
Show dynamically bound and formatted text
// Displays either 'Is active' or 'Is not active', depending on the data field
const textComponent = new TextComponent(myDataModel, {
dataField: 'isActive', // a boolean field
dataFieldFormatter: (value) => { return value === true ? 'Is active' : 'Is not active' }
})
Members
text :string
Type:
- string
- Source:
text :string
Type:
- string
- Source: