YUI 对话框 - 使用“表单”时相当于 postdata 的是什么? (不是(“异步”)

发布于 2024-08-02 07:08:05 字数 356 浏览 3 评论 0原文

我正在使用 YAHOO.widget.Dialog 创建一个对话框。通过单击链接来触发对话框,链接使用的函数指定最终添加到 postdata 选项的参数,如下所示:

  var myDialog = new YAHOO.widget.Dialog("myDialog", {
    fixedcenter: true,
    // postmethod: "form",
    postdata: propString
  });

这工作得很好,但现在我需要做同样的事情,但使用“form”代替“异步” - 并且没有用于表单提交的后期数据。

这样做的正确方法是什么?

(YUI 2.7.0)

I'm creating a dialog with YAHOO.widget.Dialog. The dialog is fired off by clicking on a link, and the function the link uses specifies parameters that finally get added to a postdata option like so:

  var myDialog = new YAHOO.widget.Dialog("myDialog", {
    fixedcenter: true,
    // postmethod: "form",
    postdata: propString
  });

This works just fine, but now I need to do the same thing but using "form" instead of "async" - and there's no postdata for form submissions.

What's the right way to do this?

(YUI 2.7.0)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初雪 2024-08-09 07:08:05

这是一个例子:

var dlg= new YAHOO.widget.Dialog("objectDlg",{
close: false,
draggable: false,
hideaftersubmit: false,
modal: true,
fixedcenter: true,
visible: false,
constraintoviewport: true,
dataURL: saveObjectURL,
buttons: [{'text': 'Save',handler: function(){
    var postdata= ...
    this.cfg.setProperty("postdata", postdata); //this is important
    this.submit();}, 'isDefault': false},
    {'text': 'Cancel', handler: function() {this.cancel();}, 'isDefault': true}] });
dlg.render(document.body);

希望有帮助

Here is an example:

var dlg= new YAHOO.widget.Dialog("objectDlg",{
close: false,
draggable: false,
hideaftersubmit: false,
modal: true,
fixedcenter: true,
visible: false,
constraintoviewport: true,
dataURL: saveObjectURL,
buttons: [{'text': 'Save',handler: function(){
    var postdata= ...
    this.cfg.setProperty("postdata", postdata); //this is important
    this.submit();}, 'isDefault': false},
    {'text': 'Cancel', handler: function() {this.cancel();}, 'isDefault': true}] });
dlg.render(document.body);

Hope it is helpful

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文