Methods
# protected _bindErrorHandler()
Makes the controller listen for the EVENT_SEND_ERROR event and show the error toast to the user
.Makes the controller listen for the EVENT_SEND_ERROR event and show the error toast to the user
# protected _bindMessageHandler()
Makes the controller listen for the EVENT_SEND_MESSAGE event and show the toast to the user
.Makes the controller listen for the EVENT_SEND_MESSAGE event and show the toast to the user
# protected _getLoader(message, optionsopt) → {ion-loading}
Instantiates a new Spinner
API:
const loader = controller._getLoader('message', options);
await loader.present();
...
Instantiates a new Spinner
API:
const loader = controller._getLoader('message', options);
await loader.present();
...
await loader.dismiss();
for styling the class
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
message |
string
|
||
options |
object
|
<optional> |
accepts params:
|
a spinner
ion-loading
# bindLocale(controller, pageNameopt, enableValidationsopt)
Adds the locale info to the model.
Adds the locale info to the model.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
controller |
LocalizedController
|
||
pageName |
string
|
<optional> |
|
enableValidations |
boolean
|
<optional> |
defaults to false. If provided enabled Ionic Inputs form validations |
# closeIonicModal()
- Deprecated:
- Yes
# on(eventName, handler, options)
Override just for the special case of EVENT_SSAPP_HAS_LOADED to set it on document body and not the element it self because its raised on the body level
.Override just for the special case of EVENT_SSAPP_HAS_LOADED to set it on document body and not the element it self because its raised on the body level
Parameters:
| Name | Type | Description |
|---|---|---|
eventName |
||
handler |
||
options |
# refresh(detailopt)
Calls Refresh on the controller
.Calls Refresh on the controller
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
detail |
Object
|
<optional> |
option props to pass on the event |
# async showAlert(message, options) → {HTMLElement}
Shows an alert with the specified message.
Shows an alert with the specified message.
Standard Usage:
const alert = await controller.showAlert('this is an alert message');
const { role } = await alert.onDidDismiss();
console.log('onDidDismiss resolved with role', role);
if (role === 'confirm') ...
if (role === 'cancel') ...
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string
|
|
options |
object
|
object with additional configuration options:
{
cssClass: '...' css class to be used. defaults to 'ssapp-alert'
header: '...' Title text (optional)
subHeader: '...' subTitle text (optional)
buttons: [
{
text: '...' button text,
role: '...' sets a role to be caught by the handler method
cssClass: '...' additional styling
handler: (e) => { (optional and not recommended)
console.log(e);
}
}
]
}
defaults to:
{
buttons: [
{
text: 'Ok',
role: 'confirm'
},
{
text: 'Cancel',
role: 'cancel'
}
]
}
|
HTMLElement
# showBarcodeScanner(propsopt, callback)
Integrates with PdmBarcodeScannerController.
Integrates with PdmBarcodeScannerController. that mean that element needs to be somewhere, typically inside ion-tabs
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
props |
Object
|
<optional> |
props to pass to scanner:
|
callback |
function
|
# async showConfirm(message, confirmText, cancelText) → {Promise.<HTMLElement>}
Shows a confirmation Popup
.Shows a confirmation Popup
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
message |
string
|
the message |
|
confirmText |
string
|
the ok button text |
|
cancelText |
string
|
Cancel | the cancel button text |
Promise.<HTMLElement>
# showErrorToast(message, erropt)
Shows a Toast via showToast with
- header: 'Error'
- cssClass: 'danger
- button: 'Close'
Shows a Toast via showToast with
- header: 'Error'
- cssClass: 'danger
- button: 'Close'
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
message |
string
|
||
err |
err
|
<optional> |
# showIonicModal(modalName, swipeToCloseopt, paramsopt)
Shows an Ionic model
.Shows an Ionic model
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
modalName |
string
|
the modal's name registered via:
customElements.define('registration-modal', class extends HTMLElement{
connectedCallback(){
this.innerHTML = `
|
|
swipeToClose |
boolean
|
<optional> |
enables slideToClose when available. defaults to false |
params |
object
|
<optional> |
passes param to modal (ionic functionality) |
- Deprecated:
- Yes
# async showPopup(popupOptions:, callbackopt) → {Promise.<HTMLElement>}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
popupOptions: |
Object
|
{ message: string; generic message confirmText: string; cancel button label cancelText: string; cancel button label options: alert ionic options } |
|
callback |
function
|
<optional> |
Promise.<HTMLElement>
# showToast(message, headeropt, cssClassopt, button, buttonHandler)
Shows Toast Alert
.Shows Toast Alert
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
message |
string
|
||
header |
string
|
<optional> |
if given will be presenter in the header |
cssClass |
string
|
Array.<string>
|
<optional> |
|
button |
string
|
the text on the close button |
|
buttonHandler |
function
|