Qooxdoo 对话框
我想在 Qooxdoo 应用程序中添加一些对话框,但我不知道如何在某些情况下定义它们。
在 Qooxdoo 演示中(它是小部件 - 窗口示例,函数 getModalWindow2),我看到窗口可以像简单的 JS 函数一样定义,返回其小部件。 Qooxdoo 中是否有更好的对话框制作方法?
据我了解,我可以为对话框窗口定义类并为该类设置一些类属性。那么,如何在应用程序中添加一些表单复杂的对话框呢?
例如,它可以是服务器上的用户目录树。当用户按下“确定”按钮并且该对话框将关闭后,树的选定元素必须存储在对话框类的对象中的某个位置。
I want to have some dialogs in Qooxdoo applications, but I don't know how to define them for some situations.
In Qooxdoo demos (it was widget - window example, function getModalWindow2), I seen that window can be defined like a simple JS function, returning its widget.
Is there better way to make dialogs in Qooxdoo?
As I understood, I can define class for dialog window and set some class properties for this class. So, how to add some dialogs with complex forms in application?
For example, it may be a tree of user directory on the server. And selected element of tree must be stored somewhere in object for the dialog class after user will press "Ok" button and this dialog will be closed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在我找到了我自己问题的答案(在关于Qooxdoo的俄语博客中,在这里我将翻译答案)。
因此,主应用程序和对话框的单独文件中有单独的类。
在对话框中,我们添加 qx.event.type.Data 以通过此事件输出结果。
例如,我们有 Qooxdoo 应用程序,其名称为“custom”,如文档中所示。
在 Application.js 中,我们将此代码与类一起使用:
e.getData() 给出结果信息。
然后我们必须为该类创建名为 UserDialog.js 的文件,其中包含事件和表单:
Now I found answer to my own question (in the Russian blog about Qooxdoo, here I will translate the answer).
So, there are separate classes in separate files for main application and the dialog.
In dialog, we are adding the qx.event.type.Data for result output through this event.
So, for example we are having the Qooxdoo application, that is named "custom", like in documentation.
In Application.js we are putting this code to work with class:
e.getData() is giving the resulting information.
Then we must create file named UserDialog.js for the class, containing event and form: