Methods
(static) clearValidate()
Clear Form Validation In Dialog
Example
var myDialog = this.getComponent('myDialog')
myDialog.clearValidate()
(static) close()
Close The Dialog
Example
var myDialog = this.getComponent('myDialog')
myDialog.close()
(static) confirmLoading(status)
Set A Loading Spinner On Save Button
Example
// Show Loading Spinner On Save Button
myDialog.confirmLoading(true)
// await [Do Some Work]
// Hide Loading Spinner On Save Button
myDialog.confirmLoading(false)
Parameters:
Name | Type | Description |
---|---|---|
status |
boolean | var myDialog = this.getComponent('myDialog') |
(static) disabled(fields)
A disabled input field is unusable and un-clickable.
Examples
// Disable Form Fields
var myDialog = this.getComponent('myDialog')
var disabledFieldsArray = ['name', 'age']
myDialog.disabled(disabledFieldsArray, true)
// Enable Form Fields For User Interaction
var myDialog = this.getComponent('myDialog')
var disabledFieldsArray = ['name', 'age']
myDialog.disabled(disabledFieldsArray, false)
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array | Array of items |
|
boolean |
(static) display(fields)
Display Form Fields In The Dialog. This is opposite of hide function
Example
var myDialog = this.getComponent('myDialog')
var fieldsArray = ['name', 'age']
myDialog.display(fieldsArray)
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array | Array of items |
(static) getValue(fieldName)
Get A Value From An Object
Example
var myData = {name: 'Joe Blogs', age: 30};
var myDialog = this.getComponent('myDialog')
var data = myDialog.getValue('name')
console.log(data) // 'Joe Blogs'
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string | Field Name returns Value of the selected field |
Returns:
'Joe Blogs'
(static) getValues() → {Object}
Get the values of all fields in the dialg
Example
var myDialog = this.getComponent('myDialog')
var data = myDialog.getValues()
console.log(data) // {name: 'XYZ', age: 28, country: 'United Kingdom'}
Returns:
- Type
- Object
(static) hide(fields)
Hide Form Fields In The Dialog. This is opposite of display function
Example
var myDialog = this.getComponent('myDialog')
var fieldsArray = ['name', 'age']
myDialog.hide(fieldsArray)
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array | Array of items |
(static) open()
Open The Dialog
Example
var myDialog = this.getComponent('myDialog')
myDialog.open()
(static) setData(Value)
Set Data
Example
var myData = {name: 'Joe Blogs', age: 30}
this.setData(myData)
Parameters:
Name | Type | Description |
---|---|---|
Value |
Object | Key-Value pair |
(static) setOptions(fields, options)
Dynamically Set Form Validation Rules In Dialog
Example
var myDialog = this.getComponent('myDialog')
var fieldsArray = ['name']
var options = {required: true, placeholder: 'Enter Name', defaultValue: 'XYZ'}
myDialog.setOptions(fieldsArray, options)
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array | Array of items |
options |
Object | Key-Value Pairs |
(static) validate()
Validate The Form In Dialog
Example
var myDialog = this.getComponent('myDialog')
myDialog.validate()