Is it possible to return data via Ajax? #62
Unanswered
anthonycalvano
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This is a good point and a use-case I haven't thought of so far. Indeed, it would be quite easy to return additional data, rather than the If you think this helps, I might add this as a feature in version 1.1. Please create an issue for this feature request. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've created a search form where you the user can enter search criteria and when they hit submit, the search results would, ideally, appear below the form. I'm using FormCollectionView to create the form as the user can add multiple criteria forms before submitting. I'm using the form_collection_valid method to get the cleaned_data so I can perform the search on the database. But at this point I'm not sure how to return the results to the browser. This method can only return a success_url. Is there a way to return the results via Ajax, so the page doesn't reload? I can save the values to the database and my success_url have parameters to reference the saved data, but I would prefer to do this all in the same view, if possible, and not have to save the data if the user doesn't need it for later.
Beta Was this translation helpful? Give feedback.
All reactions