mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "afterRender" callback for modal forms
This commit is contained in:
parent
1360b1592d
commit
d87ab0033a
@ -258,6 +258,8 @@ function constructForm(url, options) {
|
|||||||
constructFormBody({}, options);
|
constructFormBody({}, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.fields = options.fields || {};
|
||||||
|
|
||||||
// Save the URL
|
// Save the URL
|
||||||
options.url = url;
|
options.url = url;
|
||||||
|
|
||||||
@ -517,6 +519,11 @@ function constructFormBody(fields, options) {
|
|||||||
|
|
||||||
initializeGroups(fields, options);
|
initializeGroups(fields, options);
|
||||||
|
|
||||||
|
if (options.afterRender) {
|
||||||
|
// Custom callback function after form rendering
|
||||||
|
options.afterRender(fields, options);
|
||||||
|
}
|
||||||
|
|
||||||
// Scroll to the top
|
// Scroll to the top
|
||||||
$(options.modal).find('.modal-form-content-wrapper').scrollTop(0);
|
$(options.modal).find('.modal-form-content-wrapper').scrollTop(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user