Class TableComponent

new TableComponent($id)

inherits from Component

NameTypeDescription
$id String Uniquely identifies the instance of this class

Methods

PermalinkaddColumn


addColumn($id, $name, $opts)

Adds a column to the table

Params
NameTypeDescription
$id String A unique id for this column which also corrresponds to the keys of row array
$name String The name of the column which is displayed in the table
$opts String Array of options

PermalinkaddRow


addRow($row)

Add a row of data to the table. This will need to be provided as an associative array whose keys correspond to individual column keys.

Params
NameTypeDescription
$row Array An associative array containing the data to be displayed in a row

PermalinksetRowsPerPage


setRowsPerPage($numRows)

Sets the number of rows per page in the table

Params
NameTypeDescription
$numRows Number The number of rows in a single page on the table

PermalinkaddMultipleRows


addMultipleRows($rows)

Adds multiple rows of data to the table at once. Note that the each row need to be provided as an associative array whose keys match the column keys

Params
NameTypeDescription
$rows Array Array of row arrays, where each row is an associative array

PermalinkclearRows


clearRows()

Clears all the rows in the table.

Params
None

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