WIP new app.ts method dialogExec(_menuaction) opening a popup into a dialog

ToDo: overwrite Framework actions in etemplate2.handle_load() to eg. close dialog, but not window, or refresh window instead of opener
This commit is contained in:
ralf
2023-07-11 13:38:09 +02:00
parent d93aa1e91c
commit f518f61335
3 changed files with 35 additions and 5 deletions

View File

@ -747,6 +747,29 @@ export abstract class EgwApp
this.et2_view.close = destroy;
}
/**
* Opens _menuaction in an Et2Dialog
*
* @param _menuaction
* @return Promise<any>
*/
dialogExec(_menuaction : string)
{
const ajax = this.egw.json(_menuaction.match(/^([^.:]+)/)[0] + '.jdots_framework.ajax_exec.template.' + _menuaction,
['index.php?menuaction=' + _menuaction], _response =>
{
if (Array.isArray(_response) && typeof _response[0] === 'string')
{
jQuery(_response[0]).appendTo(document.body);
}
else
{
console.log("Invalid response to dialogExec('"+_menuaction+"')", _response);
}
});
return ajax.sendRequest();
}
/**
* Merge selected entries into template document
*