new ServicesHelper()
This class contains the methods that will be used by the "Services" tab of the page.
- Source:
Methods
-
delete(id)
-
Delete a service record from database.
Parameters:
Name Type Description id
numeric Record id to be deleted. - Source:
-
display(service)
-
Display a service record into the service form.
Parameters:
Name Type Description service
object Contains the service record data. - Source:
-
filter(key, selectId, display)
-
Filters service records depending a string key.
Parameters:
Name Type Description key
string This is used to filter the service records of the database. selectId
numeric (OPTIONAL = undefined) If set then after the filter operation the record with this id will be selected (but not displayed). display
bool (OPTIONAL = false) If true then the selected record will be displayed on the form. - Source:
-
getFilterHtml(service) → {string}
-
Get a service row html code that is going to be displayed on the filter results list.
Parameters:
Name Type Description service
object Contains the service record data. - Source:
Returns:
The html code that represents the record on the filter results list.- Type
- string
-
resetForm()
-
Resets the service tab form back to its initial state.
- Source:
-
save(service)
-
Save service record to database.
Parameters:
Name Type Description service
object Contains the service 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 service 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(service) → {bool}
-
Validates a service record.
Parameters:
Name Type Description service
object Contains the service data. - Source:
Returns:
Returns the validation result.- Type
- bool