From c9d89b348c22d50e3a9a8564dd6c98d1c75acfb7 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 20 Feb 2024 16:52:47 -0700 Subject: [PATCH] Docs for Vfs select dialog --- api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.md | 23 +++++++++++++++++++ api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts | 5 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.md diff --git a/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.md b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.md new file mode 100644 index 0000000000..8427a0b3ee --- /dev/null +++ b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.md @@ -0,0 +1,23 @@ +You can get the files by: + +### Widget value + +The dialog will return values on submit back to the server + +### Change event + +When the selected file(s) change, the change event is fired + +```js +const dialog = this.et2.getWidgetById("files"); +dialog.addEventListener("change", this.handleFilesSelected); +``` + +### getComplete() Promise + +When the user closes the dialog, getComplete() will return the selected files + +```js +const dialog = this.et2.getWidgetById("files"); +let files = await dialog.getComplete(); +``` diff --git a/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts index ec65b4a39f..f94c70bb61 100644 --- a/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts +++ b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts @@ -26,8 +26,9 @@ import {Et2VfsSelectRow} from "./Et2VfsSelectRow"; import {Et2VfsPath} from "./Et2VfsPath"; /** - * @summary Select files (including directories) from the VFS - * @since 23.1 + * @summary Select files (including directories) from the VFS. + * + * The dialog does not do anything with the files, just handles the UI to select file. * * @dependency et2-box * @dependency et2-button