new (require("core_form/dynamicform"))(container, formClass)
- Description:
Constructor
Creates an instance
- Source:
Parameters:
Name | Type | Description |
---|---|---|
container |
Element | the parent element for the form |
formClass |
string | full name of the php class that extends \core_form\modal , must be in autoloaded location |
Classes
Members
events :Object
- Description:
Various events that can be observed.
- Source:
Various events that can be observed.
Type:
- Object
Methods
addEventListener(…args)
- Description:
Add listener for an event
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
array |
<repeatable> |
disableButtons()
- Description:
Disable buttons during form submission
- Source:
enableButtons()
- Description:
Enable buttons after form submission (on validation error)
- Source:
getFormNode() → {HTMLFormElement}
- Description:
Get the form node from the Dialogue.
- Source:
Returns:
- Type
- HTMLFormElement
load(args) → {Promise}
- Description:
Loads the form via AJAX and shows it inside a given container
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
args |
Object |
null
|
Returns:
- Type
- Promise
notifyResetFormChanges()
- Description:
Notifies listeners that form dirty state should be reset.
- Source:
Fires:
- event:formSubmittedByJavascript
onSubmitSuccess(response)
- Description:
On form submit
- Source:
Parameters:
Name | Type | Description |
---|---|---|
response |
* | Response received from the form's "process" method |
processCancelButton()
- Description:
Click on a "cancel" button
- Source:
(async) submitFormAjax()
- Description:
Submit the form via AJAX call to the core_form_dynamic_form WS
- Source:
updateForm(param) → {Promise}
- Description:
Update form contents
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
param |
object |
Properties
|
Returns:
- Type
- Promise
validateElements() → {Boolean}
- Description:
Validate form elements
- Source:
Fires:
- event:formSubmittedByJavascript
Returns:
Whether client-side validation has passed, false if there are errors
- Type
- Boolean
(inner) submitButtonPressed(button)
- Description:
Click on a "submit" button that is marked in the form as registerNoSubmitButton()
- Source:
Parameters:
Name | Type | Description |
---|---|---|
button |
Element | that was pressed |
Fires:
- event:formSubmittedByJavascript