mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Provide an after_render callback
- User callback after the form data are rendered
This commit is contained in:
parent
57645486cc
commit
0cc2e71843
@ -401,6 +401,10 @@ function handleModalForm(url, options) {
|
||||
else {
|
||||
if (response.html_form) {
|
||||
injectModalForm(modal, response.html_form);
|
||||
|
||||
if (options.after_render) {
|
||||
options.after_render(modal, response);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(modal).modal('hide');
|
||||
@ -443,6 +447,7 @@ function launchModalForm(url, options = {}) {
|
||||
* submit_text - Text for the submit button (default = 'Submit')
|
||||
* close_text - Text for the close button (default = 'Close')
|
||||
* no_post - If true, only display form data, hide submit button, and disallow POST
|
||||
* after_render - Callback function to run after form is rendered
|
||||
*/
|
||||
|
||||
var modal = options.modal || '#modal-form';
|
||||
@ -475,6 +480,10 @@ function launchModalForm(url, options = {}) {
|
||||
if (response.html_form) {
|
||||
injectModalForm(modal, response.html_form);
|
||||
|
||||
if (options.after_render) {
|
||||
options.after_render(modal, response);
|
||||
}
|
||||
|
||||
if (options.no_post) {
|
||||
modalShowSubmitButton(modal, false);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user