{"inframe":false,"title":"打开对话框","hidden":false,"roles":{"demo":1,"dev":1},"children":[{"configs":{"itemId":"sys.dialog.openFile"},"events":{"initialize":"Wb.apply(app, {\n  /**\n   * 显示文件对话框。\n   * @param {function} callback 点击对话框确定按钮时执行的方法。\n   * @param {Array} callback.fileNames 选择的文件列表。\n   * @param {Ext.window.Window} callback.win 文件对话框窗口。\n   * @param {Object} callback.scope app scope对象。\n   * @param {Boolean} [multiSelect] 是否允许多选，默认为false。\n   * @param {Boolean} [forceSelection] 是否必须选择文件。\n   * @param {String} [extName] 文件扩展名。\n   * @return {Object} app scope对象。\n   */\n  show: function(callback, multiSelect, forceSelection, extName) {\n    var selModel = app.fileModule.fileGrid.selModel;\n    selModel.deselectAll();\n    selModel.setSelectionMode(multiSelect ? 'MULTI' : 'SINGLE');\n    app.multiSelect = multiSelect;\n    app.fileModule.multiSelect = multiSelect;\n    app.fileModule.fileNameText.forceSelection = forceSelection;\n    app.fileModule.fileNameText.setValue('');\n    app.callback = callback;\n    app.extName = extName;\n    app.win.show();\n    return app;\n  },\n  /**\n   * 显示打开对话框，说明见show方法。\n   */\n  open: function(callback, multiSelect) {\n    return app.show(callback, multiSelect, true);\n  },\n  /**\n   * 显示保存对话框，说明见show方法。\n   */\n  save: function(callback, extName) {\n    return app.show(callback, false, false, extName);\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, app]);\n    } else\n      Wb.warn('文件名称不能为空。');\n  }\n});"},"children":[{"configs":{"title":"选择文件","height":"450","width":"1000","layout":"fit","resizable":"true","closeAction":"hide","defaultFocus":"fileNameText","dialog":"true","itemId":"win","iconCls":"explorer_icon","maximizable":"true"},"events":{"afterrender":"app.fileModule.fileNameBar.setVisible(true);\napp.fileModule.statusBar.setVisible(false);\napp.fileModule.dblClickFileHandler = app.done;","ok":"app.done();"},"children":[{"configs":{"file":"file","itemId":"fileModule"},"children":[],"expanded":false,"type":"xwl"}],"expanded":true,"type":"window"}],"expanded":true,"type":"module"}],"pageLink":"","iconCls":""}