BIC-jQM: Pending Queue Process
the user clicks the submit button
the click-handler for the submit button is the
formSubmit()
method of the FormControlViewformSubmit()
calls theaddToQueue(status)
method, with a status of "Pending" which declares that the form record is ready for submissionany other status (e.g. "Draft") saves the form record locally and does not trigger network submission
addToQueue()
retrieves the data from the current form record and stores it along with some form metadata to theBMP.BIC.pending
Backbone CollectionaddToQueue()
callsBMP.BIC.pending.processQueue()
and then navigates away from the form interaction, allowing the submission to complete in the backgroundthe PendingCollection's
processQueue()
method identifies all pending items with a "Pending" status and attempts to submit them via the networkevent handlers created in
addToQueue()
display the successful submission pop-up