{"inframe":false,"title":"文件打开对话框","hidden":false,"roles":{"demo":1,"dev":1},"children":[{"configs":{"itemId":"module"},"children":[{"configs":{"defaults":"{\n  margin: 8\n}","itemId":"viewport1"},"children":[{"configs":{"flat":"true","html":"请点击按钮调用文件打开对话框，该对话框采用单例模式，默认关闭为隐藏，除非显式调用Ext.destroy(sys.dialog.openFile)方法销毁该对话框。","itemId":"text"},"children":[],"expanded":false,"type":"panel"},{"configs":{"text":"打开文件对话框","itemId":"button1"},"events":{"click":"//callback为文件对话框点击确定时的回调函数，参数为选择的文件路径数组\nfunction openFile(callback) {\n  if (Wb.hasNS('sys.dialog.openFile'))\n    sys.dialog.openFile.open(callback); //保存对话框为openFile.save()\n  else\n    Wb.run({\n      url: 'open-dialog',\n      success: function(scope) {\n        //scope==sys.dialog.openFile\n        scope.open(callback); //保存对话框为openFile.save()\n      }\n    });\n}\nopenFile(function(fileNames, win) {\n  if (fileNames.length)\n    Wb.info('您选择的文件：' + Wb.encode(fileNames), function() {\n      win.close();\n    });\n  else\n    Wb.warn('请选择至少一个文件。');\n});"},"children":[],"expanded":false,"type":"button"}],"expanded":true,"type":"viewport"}],"expanded":true,"type":"module"}],"pageLink":"","iconCls":""}