In my application I have 2 Views .
One of them is sending the data to the server when the client clicks on submit .
The other needs to wait for this response and run to work with the 'upgraded' data.
How would I do such a thing?
In my application I have 2 Views .
One of them is sending the data to the server when the client clicks on submit .
The other needs to wait for this response and run to work with the 'upgraded' data.
How would I do such a thing?
The easiest way would be to use the native features of the backbone collection.
Option 1:
Perform insertion (POST) via collection.
In view 2 use a new collection pointing to the same url, and listen for the add event to add the new item inserted in the collection (server) using fetch with the remove option as false if you do not want the entire collection to be upgraded: ( backbone-collection-fetch )
collection.fetch({remove: false});
Option 2:
In view 2 :