jquery - How to show an animated spinner while a background task is processing in nested rails model using ajax -
My specific example is extremely complex, so I will use the example shown by Ryan to discuss this: < / P>
Background
I have a form, we say "survey", in which there is an arbitrary number of "questions".
Senario
I am on the "Edit Survey" page.
I would like to add a button to each "Question" field which calls a remote_function, which in turn has a delay in the line to delay the processing on "Question".
To give feedback to the user, I want to disable the button, and show an animated spinner, which remains until the delayed_job has processed the "question".
Gesture - I can add methods of "question" model to indicate late status of work.
So, with the best practices in mind, what is the best way to get it?
Vote and respond with json like this:
{"End": [1,3,3]}
then add the vote javascript
var interval = setInterval (function () {$. Hide the spinner with {// id = data} for the get ("test.json", function (data) {{i end up in data}. [I]}}}}}}, 5000) // time in milliseconds < / Code>
Comments
Post a Comment