Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature for Deferred #527

Closed
luwfls opened this issue May 27, 2017 · 1 comment
Closed

feature for Deferred #527

luwfls opened this issue May 27, 2017 · 1 comment

Comments

@luwfls
Copy link

luwfls commented May 27, 2017

  • I think ajaxSubmit shoud be a deferred Object 。 so that we can use $.when()
  • usecase as below
    var deferreds = [];
    // there are more than one form 
    $("form").each(function () {
        deferreds.push($(this).ajaxSubmit({
            success: function (data) {
                console.log(data);
                $(this).find("input[name$='id']").val(data.id);
                $(this).find("input[name$='materiaName']").val(data.materiaName);
                $(this).find("#preview-btn").unbind("click");
                $(this).find("#preview-btn").attr("onclick", "openImgeMadal(" + data.url + ")");
            }
        }));
    });
    $.when.apply($, deferreds).done(function () {
        console.log("all ajax down");
    });
@kevindb
Copy link
Contributor

kevindb commented Jun 7, 2020

I am closing this issue due to a lack of activity. If you still need help, please comment and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants