Class FormComponent

new FormComponent($id)

inherits from Component

NameTypeDescription
$id String Uniquely identifies the instance of this class

Methods

PermalinkaddTextField


addTextField($id, $label, $options)

Add a text field represented by a HTML Text input on the form

Params
NameTypeDescription
$id String Id for this field used to retrieve the value
$label String The label that is displayed in the form element for the user
$options Array The options as an associative array

PermalinkaddSelectField


addSelectField($id, $label, $list, $options)

Add a select/dropdown field which allows the user to select one option from a list of pre-defined options. This is displayed as a HTML Select input on the form

Params
NameTypeDescription
$id String Id for this field used to retrieve the value
$label String The label that is displayed in the form element for the user
$list Array An array of strings which are the options in the select items
$options Array The options as an associative array

PermalinkaddMultiSelectField


addMultiSelectField($id, $label, $list, $options)

Add a multi-select field which allows the user to select one option from a list of pre-defined options. This is displayed as a HTML multi select input on the form

Params
NameTypeDescription
$id String Id for this field item used to retrieve the value
$label String The label that is displayed in the form element for the user
$list Array An array of strings which are the options in the select items
$options Array The options as an associative array

PermalinkaddDateField


addDateField($id, $label, $options)

Add a select/dropdown field which allows the user to select a single date. This is displayed with a date picker.

Params
NameTypeDescription
$id String Id for this field used to retrieve the value
$label String The label that is displayed in the form element for the user
$options Array The options as an associative array

PermalinkaddDateRangeField


addDateRangeField($id, $label, $options)

Adds a Date Range field to the component. This field can be used to select a date range, a start date and an end date.

Params
NameTypeDescription
$id String Id for this field item used to retrieve the value
$label String The label that is displayed in the form element for the user
$options Array The options as an associative array

PermalinkaddNumericRangeField


addNumericRangeField($id, $label, $values, $options)

Adds a Numeric Range field to the component. This field can be used to select a numeric range, a start number and an end number.

Params
NameTypeDescription
$id String Unique id for this field
$label String The name displayed on the control
$values Array The default values for the start and end numbers
$options Array Array of options

PermalinkaddCheckboxField


addCheckboxField($id, $label, $value)

Add a checkbox field displayed as a HTML checkbox in the form.

Params
NameTypeDescription
$id String Id for this field item used to retrieve the value
$label String The label that is displayed in the form element for the user
$value Boolean If the checkbox is supposed to be checked by default

PermalinkonApplyClick


onApplyClick($lockedComponents, $func)

Adds an on apply click handler

Params
NameTypeDescription
$lockedComponents Array Components to be locked
$func String Function name to be executed on apply form

PermalinkgetAllInputValues


getAllInputValues()

Get all the input values

Params
None

PermalinkgetInputValue


getInputValue($id)

Get input value by id

Params
NameTypeDescription
$id String The id of a specific field item

PermalinkgetType


getType()

Gets the type of this component

Params
None

Inherited Methods

PermalinksetCaption


setCaption($caption)

Set the caption of this component which is the text displayed on top of the component

Params
NameTypeDescription
$caption String Caption text to be displayed on the component

PermalinksetDimensions


setDimensions($w, $h)

Set the dimensions of the component. The dimensions are based on a 12-column grid

Params
NameTypeDescription
$w Number Width of the Component in Units
$h Number Height of the Component in Units

PermalinkhideComponent


hideComponent()

Hides a component from the dashboard

Params
None

PermalinkshowAsModal


showAsModal()

Show a hidden component in a modal

Params
None

PermalinkaddComponentKPI


addComponentKPI($id, $options)

Add a simple Key Performance Indicator (KPI/Metric) attached to the bottom of the component.

Params
NameTypeDescription
$id String A unique ID to identify the component KPI
$options ComponentKPIProperties The options as an Associative Array
Properties Show
NameTypeDescription
caption string The caption to display for the component KPI
numberFormatFlag boolean If set to true, the number will be formatted as per the options.
numberHumanize boolean Uses K, M and B to denote thousands, millions and billions respectively.
numberPrefix string Adds a string perfix to the number.
numberSuffix string Adds a string suffix to the number.
numberDecimalPoints number Number of decimal places to show.

PermalinkupdateComponentKPI


updateComponentKPI($id, $options)

Updates the Component KPI

Params
NameTypeDescription
$id String A unique ID to identify the component KPI. This has to be the same as the one used to add the component kpi
$options Array Array with the new value to set

PermalinkremoveComponentKPI


removeComponentKPI($id)

Removes a Component KPI

Params
NameTypeDescription
$id String A unique ID to identify the component KPI. This has to be the same as the one used to add the component kpi

PermalinkoverrideDisplayOrderIndex


overrideDisplayOrderIndex($idx)

Sets the index of the component on the dashboard. The component order on the dashboard is based on this index.

Params
NameTypeDescription
$idx Number The index for this component

PermalinksetOption


setOption(key, value)

Set the value to the key passed for the particular component.

Params
NameTypeDescription
key String variable which needs to be assigned
value String value to be assigned to the key

PermalinkgetID


getID()

Get the id for this component

Params
None