Class: AdminsHelper

AdminsHelper

new AdminsHelper()

This class contains the Admins helper class declaration, along with the "Admins" 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 "Admins" tab.
Source:

delete(id)

Delete an admin record from database.
Parameters:
Name Type Description
id int Record id to be deleted.
Source:

display(admin)

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

filter(key, selectId, display)

Filters admin records depending a key string.
Parameters:
Name Type Description
key string This string is used to filter the admin records of the database.
selectId numeric (OPTIONAL = undefined) This record id will be selected when the filter operation is finished.
display bool (OPTIONAL = false) If true the selected record data are going to be displayed on the details column (requires a selected record though).
Source:

getFilterHtml(admin) → {string}

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

resetForm()

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

save(admin)

Save admin record to database.
Parameters:
Name Type Description
admin 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 a specific record from the current filter results. If the admin id does not exist in the list then no record will be selected.
Parameters:
Name Type Description
id numeric The record id to be selected from the filter results.
display bool (OPTIONAL = false) If true then the method will display the record on the form.
Source:

validate(admin) → {bool}

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