mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
UNIFIAPI v0.3
This commit is contained in:
@@ -182,10 +182,6 @@ function showModalPopupForm(
|
||||
$(`#${prefix}-cancel`).html(btnCancel);
|
||||
$(`#${prefix}-OK`).html(btnOK);
|
||||
|
||||
if (callbackFunction != null) {
|
||||
modalCallbackFunction = callbackFunction;
|
||||
}
|
||||
|
||||
if (triggeredBy != null) {
|
||||
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
|
||||
}
|
||||
@@ -242,6 +238,31 @@ function showModalPopupForm(
|
||||
// $(`#${prefix}-field`).focus();
|
||||
// }, 500);
|
||||
|
||||
// Bind OK button click event
|
||||
$(`#${prefix}-OK`).off("click").on("click", function() {
|
||||
let settingsArray = [];
|
||||
if (Array.isArray(popupFormJson)) {
|
||||
popupFormJson.forEach(field => {
|
||||
collectSetting(
|
||||
`${parentSettingKey}_popupform`, // prefix
|
||||
field.function + '_in', // setCodeName + sourceSuffixes
|
||||
field.type, // setType (object)
|
||||
settingsArray
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
console.log("Collected popup form settings:", settingsArray);
|
||||
|
||||
if (typeof modalCallbackFunction === "function") {
|
||||
modalCallbackFunction(settingsArray);
|
||||
}
|
||||
|
||||
$(`#${prefix}`).modal("hide");
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Show modal
|
||||
$(`#${prefix}`).modal("show");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user