{"hidden":false,"children":[{"configs":{"itemId":"sys.dialog.openFile"},"expanded":true,"children":[{"configs":{"layout":"fit","itemId":"win","dialog":"true","focusControl":"fileNameText","resizable":"true","width":"1000","title":"选择文件","iconCls":"explorer_icon","height":"450","maximizable":"true"},"expanded":true,"children":[{"configs":{"itemId":"fileModule","file":"file"},"expanded":false,"children":[],"type":"xwl"}],"type":"window","events":{"hide":"Ext.callback(app.hideEvent, app, [app]);","afterrender":"app.fileModule.fileNameBar.setVisible(true);\napp.fileModule.statusBar.setVisible(false);\napp.fileModule.dblClickFileHandler = app.done;","show":"Ext.callback(app.showEvent, app, [app]);","ok":"app.done();"}}],"type":"module","events":{"initialize":"Wb.apply(app, {\n  show: function(callback, params) {\n    var selModel = app.fileModule.fileGrid.selModel;\n    selModel.deselectAll();\n    selModel.setSelectionMode(params.multiSelect ? 'MULTI' : 'SINGLE');\n    app.multiSelect = params.multiSelect;\n    app.fileModule.multiSelect = params.multiSelect;\n    app.fileModule.fileNameText.forceSelection = params.forceSelection;\n    app.fileModule.fileNameText.setValue('');\n    app.showEvent = params.show;\n    app.hideEvent = params.hide;\n    app.callback = callback;\n    app.autoClose = params.autoClose;\n    app.extName = params.extName;\n    if (params.title)\n      app.win.setTitle(params.title);\n    else\n      app.win.setTitle('选择文件');\n    app.win.show();\n    if (params.file)\n      app.fileModule.selectPath(Wb.getPath(params.file));\n  },\n  done: function() {\n    if (app.fileModule.fileNameText.getValue()) {\n      var filenames = app.fileModule.getFileNames(app.extName);\n      if (!app.multiSelect)\n        filenames = filenames[0];\n      Ext.callback(app.callback, app, [filenames, app.win]);\n      if (Wb.getBool(app.autoClose, true))\n        app.win.close();\n    } else\n      Wb.warn('文件名称不能为空。');\n  }\n});"}}],"roles":{"demo":1},"title":"打开对话框","iconCls":"","inframe":false,"pageLink":""}