Class: ProvidersHelper

ProvidersHelper

Constructor

new ProvidersHelper()

This class contains the Providers helper class declaration, along with the "Providers" tab event handlers. By deviding the backend/users tab functionality into separate files it is easier to maintain the code.
Source:

Methods

bindEventHandlers()

Bind the event handlers for the backend/users "Providers" tab.
Source:

delete(id)

Delete a provider record from database.
Parameters:
Name Type Description
id numeric Record id to be deleted.
Source:

display(provider)

Display a provider record into the admin form.
Parameters:
Name Type Description
provider object Contains the provider record data.
Source:

editableBreakDay($selector)

Initialize the editable functionality to the break day table cells.
Parameters:
Name Type Description
$selector object The cells to be initialized.
Source:

editableBreakTime($selector)

Initialize the editable functionality to the break time table cells.
Parameters:
Name Type Description
$selector object The cells to be initialized.
Source:

filter(key, selectId, display)

Filters provider records depending a string key.
Parameters:
Name Type Description
key string This is used to filter the provider records of the database.
selectId numeric (OPTIONAL = undefined) If set, when the function is complete a result row can be set as selected.
display bool (OPTIONAL = false) If true then the selected record will be also displayed.
Source:

getFilterHtml(provider) → {string}

Get an provider row html code that is going to be displayed on the filter results list.
Parameters:
Name Type Description
provider object Contains the provider record data.
Source:
Returns:
The html code that represents the record on the filter results list.
Type
string

resetForm()

Resets the admin tab form back to its initial state.
Source:

save(provider)

Save provider record to database.
Parameters:
Name Type Description
provider object Contains the admin record data. If an 'id' value is provided then the update operation is going to be executed.
Source:

select(id, display)

Select and display a providers filter result on the form.
Parameters:
Name Type Description
id numeric Record id to be selected.
display bool (OPTIONAL = false) If true the record will be displayed on the form.
Source:

validate(provider) → {bool}

Validates a provider record.
Parameters:
Name Type Description
provider object Contains the admin data to be validated.
Source:
Returns:
Returns the validation result.
Type
bool