使用FolderBrowserDialog


本示例可参考示例文件"CaseStudy\WebViewer\调用Foxtable对象.Table"的窗口"使用
FolderBrowserDialog"。

可以在js脚本中使用FolderBrowserDialog
选择文件夹,需要指定一个回调函数用于处理用户选择的文件夹:
 

// 打开文件夹选择对话框
function openFolderBrowser() {
    const dlg = ft.FolderBrowserDialog(); //
创建文件夹选择对话框
    dlg.ShowNewFolderButton = true;
    dlg.Description = "
选择文件夹";
    dlg.CallBack = "handleFolderSelected"; //
指定回调函数
    dlg.ShowDialog();

// 回调函数:显示用户选择的文件夹路径
function handleFolderSelected(folderPath) {
    const textBox = document.getElementById("folderPathTextBox");
    textBox.value = folderPath || "
未选择任何文件夹";
}


本页地址:http://www.foxtable.com/webhelp/topics/6348.htm