-
Notifications
You must be signed in to change notification settings - Fork 142
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
Create asynchronously without updating or rendering #164
Comments
@JohannesPertl At the moment you can't do that, since as you stated specific parameters are needed. If I understand your case correctly you would like to create Feedback asynchronously, show success message but not update the existing page with given Feedback. Right? |
Yes exactly, thanks for the quick answer :) At the moment my workaround is to use the parameters with nonsense data like this: function createFeedbackAsyncModalForm() {
$(".create-feedback").modalForm({
formURL: "{% url 'create_feedback' %}",
modalID: "#create-modal",
asyncUpdate: true,
asyncSettings: {
closeOnSubmit: true,
successMessage: asyncSuccessMessageCreate,
dataUrl: "feedback/",
dataElementId: "nonsense",
dataKey: "nonsense",
addModalFormFunction: createFeedbackAsyncModalForm
}
});
}
createFeedbackAsyncModalForm(); and in the views.py def feedback(request):
if request.method == 'GET':
return HttpResponse(200) It would be cleaner if those workarounds were not needed |
@JohannesPertl I'll do my best to sort this out as soon as possible. |
I was hoping to have this kind of implementation in Asyn for some of my models. Where I want to create a model without giving any other parameter except : SuccessMessage. So that way it just close the Modal and show a success message if the model has been created Thank you Uros. |
I'm implementing a feedback form modal. All I need is a simple form that creates a Feedback model without refreshing the page after submit.
It seems that asyncSettings always needs dataUrl, dataElementId and dataKey though, or else it doesn't create an object.
Is it possible to simply create a model without those parameters?
The text was updated successfully, but these errors were encountered: