new StatusIndicator(options) → {Class}
A statusIndicator component .
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component. Properties
|
- Since
- 1.1.16
The class instance.
- Type:
- Class
import StatusIndicator from '@gravityforms/components/html/admin/elements/StatusIndicator';
function Example() {
const statusIndicatorInstance = new StatusIndicator( {
id: 'example-statusIndicator',
renderOnInit: false,
target: '#example-target',
targetPosition: 'beforeend',
theme: 'cosmos',
} );
// Some time later we can render it. This is only done if we set renderOnInit to false.
// If true it will render on initialization.
statusIndicatorInstance.init();
}
Methods
(static) init() → {void}
Initialize the component.
- Since
- 1.1.16
- Type:
- void
(static) render() → {void}
Renders the component into the dom.
- Since
- 1.1.16
- Type:
- void
(static) statusIndicatorTemplate(options) → {string}
Generates the markup for a statusIndicator in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Type:
- string
import { statusIndicatorTemplate } from '@gravityforms/components/html/admin/elements/StatusIndicator';
function Example() {
const statusIndicatorTemplateHTML = statusIndicatorTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', statusIndicatorTemplateHTML );
}