Collections

App.Collections. Collections

Collections Widget

Note: To create an instance of Collections widget, see App.Collections

Constructor

new Collections(input)

Use App.Collections.create() to create an instance

Parameters:
Name Type Description
input object

options passed to Widget constructor

Methods

_addHeaderTooltip()

Adds tooltip to each column header.

_cellRenderer()

See https://datatables.net/reference/option/columns.render#function

_createDataTable(collectionsData)

Creates datatable with the given options.

Parameters:
Name Type Description
collectionsData object

An array of objects which acts as a data source

_deleteTableRows(deletedCollections)

Deletes the table rows.

Parameters:
Name Type Description
deletedCollections Array

Deleted collections.

_getCollections()

Gets the collection data.

_getColumnHeaderByName(name)

Get the Column header by passing the column name.

Parameters:
Name Type Description
name string

Name of the column

_getColumns()

Columns list for Collections table.

_getRenderedRowCount() → {number}

Returns number of rows currently rendered in the table (includes pagination)

Returns:
Type
number

_getSelectedCollectionNames() → {Array}

Returns a list of currently selected collection names in the table.

Returns:

selected collection names or []

Type
Array

_onDraw()

Actions to perform when table is drawn.

_onResizeStop()

The event handler function which listens to widget resize stop event. The purpose of this handler function is to Set the some css property on widget inner, table wrapper and the pagination element to fix the pagination at the bottom of the widget.

_performAjaxCall(data, action)

Performs Ajax call and process the return data.

Parameters:
Name Type Description
data any

Selected collection names.

action string

Action to perform.

_processServerData(dataFromServer, action)

Process the server data.

Parameters:
Name Type Description
dataFromServer object

object containing arrays of cleared and failed collections.

action string

action to perform.

_runPostInitTask()

Post initialization task to set the direction of pagination div. This task will be executed after table has fully been initialised.

_setPaginationDropdownDirection()

Always forces the direction of pagination dropdown to upward.

_setTableBadge()

Sets badge on the widget in the for "matches / total"

_trigger(event, data)

Triggers an event. All handlers that are listening for this event will be triggered with the data parameter.

Parameters:
Name Type Description
event String

The event name that should be triggered

data *

Arbitrary data that will be passed to the event handler callback functions

_updateRowSelection(deletedCollections)

Updates the row selection.

Parameters:
Name Type Description
deletedCollections Array

Deleted collections.

_updateTableRows(emptyCollections)

Updates the table rows.

Parameters:
Name Type Description
emptyCollections Array

Empty collections.

clear()

Removes the objects from the selected collection(s).

delete()

Deletes the selected collection(s).

destroy()

Destroys Collections widget instance

initialize()

Initializes the Collections widget.

off(event, handler)

Remove a subscription.

Parameters:
Name Type Description
event String

Event to remove subscription from

handler function

Callback to remove

on(event, handler)

Subscribe to an event.

Parameters:
Name Type Description
event String

Event to subscribe to

handler function

Callback function

performSearch(value)

Searches datatable for value and redraws table with matched criteria

Parameters:
Name Type Description
value string

search criteria

render(collections)

Renders the Collections widget.

Parameters:
Name Type Description
collections object

An array of objects as a data source

setTableWrapperHeight(height)

Set the outer height of table wrapper

Parameters:
Name Type Description
height number

Input height to set

startLoader()

Starts the widget loader

startToolbarLoader()

Displays the loader indicator for the toolbar element NOTE: if Widget loader is already showing, the toolbar loader is considered redundant and will not be started

stopLoader()

Stops the widget loader

stopToolbarLoader()

Hides the loader indicator for the toolbar element